mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 12:11:36 +00:00
expose Swarm object for easy overriding
This commit is contained in:
parent
ee9ebc506c
commit
992cd77fc7
@ -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)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user