fix: the server could crash if a client sends invalid frames
This commit is contained in:
parent
3165d77f60
commit
29394dea5e
@ -47,6 +47,9 @@ export class WebSocketServer extends EventEmitter implements IWebSocketServer {
|
||||
}
|
||||
|
||||
private _onSocketConnection(socket: WebSocket, req: IncomingMessage): void {
|
||||
// An unhandled socket error might crash the server. Handle it first.
|
||||
socket.on("error", error => this._onSocketError(error))
|
||||
|
||||
const { query = {} } = url.parse(req.url ?? '', true);
|
||||
|
||||
const { id, token, key }: IAuthParams = query;
|
||||
|
Loading…
x
Reference in New Issue
Block a user