1.0.1 • Published 6 years ago

@uncut/hotel v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Room based WebSocket Manager

import { Connection, MessageHandler } from '@uncut/hotel';
import WebSocket from 'ws';

// create a ws websocket server
const wss = new WebSocket.Server({ port: 8080 });

// create a message handler
const handler = new MessageHandler();

/* and a connection for the ws server 
   and the message handler */
const con = new Connection(wss, handler);