Initial commit
This commit is contained in:
commit
d1c74c861e
57 changed files with 4568 additions and 0 deletions
11
src/websocket/connectionManager.ts
Normal file
11
src/websocket/connectionManager.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { WebSocket } from 'ws';
|
||||
import { handleMessage } from './messageHandler';
|
||||
|
||||
export const handleConnection = (ws: WebSocket) => {
|
||||
ws.on(
|
||||
'message',
|
||||
async (message) => await handleMessage(message.toString(), ws),
|
||||
);
|
||||
|
||||
ws.on('close', () => console.log('Connection closed'));
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue