WebSocket tracker should have a shorter interval – default: 2 minutes

This commit is contained in:
Feross Aboukhadijeh 2015-12-05 00:18:52 -08:00
parent 308f3e82a6
commit f56ca3031b

View File

@ -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)