diff --git a/brainlet/api/v2/gateway/index.js b/brainlet/api/v2/gateway/index.js index 9005751..611e241 100644 --- a/brainlet/api/v2/gateway/index.js +++ b/brainlet/api/v2/gateway/index.js @@ -69,6 +69,9 @@ class GatewayServer extends EventEmitter { ws.on("pong", () => { ws.alive = true; }); + ws.on("close", async () => { + if (ws.rtc) await ws.rtc.close(); + }); ws.on("message", async (data) => { try { const message = parseMessage(data);