lobby-client
A small wrapper around websockets that handles realtime connections to online lobbies. The lobby-server is needed to manage the pool of lobbies. When instantiating the LobbyClient below, the address and port that the lobby-server is listening on must be specified.
Installation
npm install lobby-client
Usage
; const lobby = ; // Later, we can send any valid json to other clients in the lobby (objects, strings)// We send our client's chess move in this examplelobby; // Disconnects explicitly from the lobby// Websockets are also closed after a long period of inactivity, which is handled by socket.iolobby;
Contributing
Pull requests are welcome. An issue can be opened for larger changes.