Skip to content

Commit 33e6d75

Browse files
committed
fix: the server could crash if a client sends invalid frames
Closes #290
1 parent d4b292d commit 33e6d75

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/services/webSocketServer/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export class WebSocketServer extends EventEmitter implements IWebSocketServer {
4747
}
4848

4949
private _onSocketConnection(socket: MyWebSocket, req: IncomingMessage): void {
50+
socket.on("error", this._onSocketError);
5051
const { query = {} } = url.parse(req.url ?? '', true);
5152

5253
const { id, token, key }: IAuthParams = query;

0 commit comments

Comments
 (0)