From c13ec65079eb7b7a906cdb3c2cf79434fa181a23 Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Fri, 26 Apr 2019 06:58:47 +1000 Subject: [PATCH] ditch clients --- plugins/wss.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/wss.js b/plugins/wss.js index 4e64f69..574de77 100644 --- a/plugins/wss.js +++ b/plugins/wss.js @@ -14,6 +14,12 @@ module.exports = { }); const wss = new WebSocket.Server({ server }); + function noop() { } + + function heartbeat() { + this.isAlive = true; + } + wss.on('connection', function connection(ws) { ws.isAlive = true; @@ -58,11 +64,6 @@ module.exports = { // ws.send('something'); }); - function noop() { } - - function heartbeat() { - this.isAlive = true; - } const interval = setInterval(function ping() { wss.clients.forEach(function each(ws) {