mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-22 17:58:31 +00:00
Initial commit
This commit is contained in:
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'));
|
||||
};
|
Reference in New Issue
Block a user