From 992cd77fc75f44dd8829393211756abbaba6debe Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 10 Mar 2017 13:38:43 -0800 Subject: [PATCH] expose Swarm object for easy overriding --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 3723516..419073b 100644 --- a/server.js +++ b/server.js @@ -280,6 +280,8 @@ function Server (opts) { } } +Server.Swarm = Swarm + Server.prototype._onError = function (err) { var self = this self.emit('error', err) @@ -352,7 +354,7 @@ Server.prototype.createSwarm = function (infoHash, cb) { if (Buffer.isBuffer(infoHash)) infoHash = infoHash.toString('hex') process.nextTick(function () { - var swarm = self.torrents[infoHash] = new Swarm(infoHash, self) + var swarm = self.torrents[infoHash] = new Server.Swarm(infoHash, self) cb(null, swarm) }) }