lobber
A library for creating and managing application lobbies.
This stuff is fairly simple, and lobber comes with a simple type of Lobby object which acts as a chatroom.
Example
In this example, you can see how to create a very simple chat application.
Server
On the server, you will need something like this.
// At the moment we need to use node-websocket for the websocket servervar http = WebSocketServer = server lobber = ; // Create a simple HTTP server.var server = http; // Listen for connections on port 8044 server; // Create a WebSocket servervar wss = httpServer: server autoAcceptConnections: false; // Create a lobber server!var lobserver = websocket: wss; // This is to prevent circular imports in lobber...var ChatLobby = lobberChatLobby; // Register a chat application, and use ChatLobby to manage individual lobbies.lobservermanager; // You need to tell the server whether to accept a request or not.// If you don't overwrite this method, all requests will be rejected!lobserver { // Connections must have an associated user object. // User objects should have an attribute `username`. // Pass this to the answer method if you accept a request. // Accept a request var user = username: 'testUser' ; ; console; };
Client
Need to make a client library...