From 8480601b0aced02576d77c30dd1cc5ee99a25efc Mon Sep 17 00:00:00 2001 From: Brian Ledbetter Date: Wed, 6 May 2020 12:36:06 -0600 Subject: [PATCH] Remove clientTracking from WebSocket.Server Previously, the `clientTracking` feature in WebSocket.Server was enabled. Unfortunately, in `socket.ts`, we remove all listeners from the `WebSocket` itself. This causes the `close` behavior removing the Socket from the `clients` list in `WebSocket.Server` not to function. Because the `terminate` functionality provided by `clientTracking` is never used with this project, the easiest solution is to remove it. --- src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f719436..45a8ea2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,12 @@ export class WsSocket { return enhancedApp.server; }; } - this.wss = new WebSocket.Server({ server: enhancedApp.server }); + this.wss = new WebSocket.Server( + { + server: enhancedApp.server, + clientTracking: false, + } + ); enhancedApp.ws = this;