Эх сурвалжийг харах

fix: the server could crash if a client sends invalid frames

Closes #290
Jonas Gloning 2 жил өмнө
parent
commit
33e6d755cc

+ 1 - 0
src/services/webSocketServer/index.ts

@@ -47,6 +47,7 @@ export class WebSocketServer extends EventEmitter implements IWebSocketServer {
   }
 
   private _onSocketConnection(socket: MyWebSocket, req: IncomingMessage): void {
+    socket.on("error", this._onSocketError);
     const { query = {} } = url.parse(req.url ?? '', true);
 
     const { id, token, key }: IAuthParams = query;