From 6fbd71c19f1e7a6969e9fa29638b497941b1d5a3 Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Thu, 27 Jun 2024 07:57:11 +0200 Subject: [PATCH] chore: terminate clients on close --- lib/listener.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/listener.js b/lib/listener.js index 76de5c5..b1ca711 100755 --- a/lib/listener.js +++ b/lib/listener.js @@ -104,6 +104,10 @@ internals.Listener.prototype._close = async function () { await Promise.all(Object.keys(this._sockets._items).map((id) => this._sockets._items[id].disconnect())); this._wss.close(); + + for (const ws of this._wss.clients) { + ws.terminate(); + } };