diff options
author | Julen Garcia Leunda <hicom150@gmail.com> | 2020-11-12 19:04:53 +0300 |
---|---|---|
committer | Julen Garcia Leunda <hicom150@gmail.com> | 2020-11-12 19:04:53 +0300 |
commit | 0ba67b8e8f54d888ba0dd14a6e5f4a18d46e1294 (patch) | |
tree | 4d831e47fcec3182e9cc33830143bcaef5be685f | |
parent | e5445be2f5d64bc545211c604e106dc3bcb10385 (diff) |
Add lsd option to client
-rw-r--r-- | index.js | 1 | ||||
-rw-r--r-- | lib/torrent.js | 6 |
2 files changed, 5 insertions, 2 deletions
@@ -70,6 +70,7 @@ class WebTorrent extends EventEmitter { this.torrentPort = opts.torrentPort || 0 this.dhtPort = opts.dhtPort || 0 this.tracker = opts.tracker !== undefined ? opts.tracker : {} + this.lsd = opts.lsd === true this.torrents = [] this.maxConns = Number(opts.maxConns) || 55 this.utp = opts.utp === true diff --git a/lib/torrent.js b/lib/torrent.js index 0db32e3..8787e53 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -334,14 +334,16 @@ class Torrent extends EventEmitter { dht: !this.private && this.client.dht, tracker: trackerOpts, port: this.client.torrentPort, - userAgent: USER_AGENT + userAgent: USER_AGENT, + lsd: this.client.lsd }) this.discovery.on('error', (err) => { this._destroy(err) }) - this.discovery.on('peer', (peer) => { + this.discovery.on('peer', (peer, source) => { + this._debug('peer %s discovered via %s', peer, source) // Don't create new outgoing TCP connections when torrent is done if (typeof peer === 'string' && this.done) return this.addPeer(peer) |