diff --git a/lib/uws-tracker.ts b/lib/uws-tracker.ts index 81a0f88..9a13b83 100644 --- a/lib/uws-tracker.ts +++ b/lib/uws-tracker.ts @@ -184,7 +184,6 @@ export class UWebSocketsTracker { compression: this.settings.websockets.compression, maxPayloadLength: this.settings.websockets.maxPayloadLength, idleTimeout: this.settings.websockets.idleTimeout, - open: this.onOpen, upgrade: this.onUpgrade, drain: (ws: WebSocket) => { if (debugWebSocketsEnabled) { @@ -196,10 +195,6 @@ export class UWebSocketsTracker { }); } - private readonly onOpen = (): void => { - this.webSocketsCount++; - }; - private readonly onUpgrade = ( response: HttpResponse, request: HttpRequest, @@ -276,6 +271,8 @@ export class UWebSocketsTracker { ); } + this.webSocketsCount++; + response.upgrade>( { sendMessage,