From f56ca3031b0267f76fb40b7093601dfe61659198 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Dec 2015 00:18:52 -0800 Subject: [PATCH] =?UTF-8?q?WebSocket=20tracker=20should=20have=20a=20short?= =?UTF-8?q?er=20interval=20=E2=80=93=20default:=202=20minutes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.js b/server.js index 46a824d..7627533 100644 --- a/server.js +++ b/server.js @@ -316,6 +316,10 @@ Server.prototype._onWebSocketRequest = function (socket, params) { var peers = response.peers delete response.peers + + // WebSocket tracker should have a shorter interval – default: 2 minutes + response.interval = Math.ceil(self.intervalMs / 1000 / 5) + response.info_hash = common.hexToBinary(params.info_hash) socket.send(JSON.stringify(response), socket.onSend)