Skip to content

Commit 992cd77

Browse files
committed
expose Swarm object for easy overriding
1 parent ee9ebc5 commit 992cd77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ function Server (opts) {
280280
}
281281
}
282282

283+
Server.Swarm = Swarm
284+
283285
Server.prototype._onError = function (err) {
284286
var self = this
285287
self.emit('error', err)
@@ -352,7 +354,7 @@ Server.prototype.createSwarm = function (infoHash, cb) {
352354
if (Buffer.isBuffer(infoHash)) infoHash = infoHash.toString('hex')
353355

354356
process.nextTick(function () {
355-
var swarm = self.torrents[infoHash] = new Swarm(infoHash, self)
357+
var swarm = self.torrents[infoHash] = new Server.Swarm(infoHash, self)
356358
cb(null, swarm)
357359
})
358360
}

0 commit comments

Comments
 (0)