Socket
Socket
Sign inDemoInstall

torrent-discovery

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

torrent-discovery - npm Package Compare versions

Comparing version 2.2.0 to 2.2.2

.travis.yml

16

index.js

@@ -32,4 +32,9 @@ module.exports = Discovery

if (!process.browser && !self.port) throw new Error('port required')
if (process.browser && (!self.announce || self.announce.length === 0))
console.warn('Warning: must specify a tracker server to discover peers (required in browser because DHT is not implemented yet) (you can use wss://tracker.webtorrent.io)')
if (process.browser && (!self.announce || self.announce.length === 0)) {
console.warn(
'Warning: specify a tracker server to discover peers. ' +
'Required in browser because DHT is not implemented yet. ' +
'(You can use wss://tracker.webtorrent.io.)'
)
}

@@ -50,10 +55,11 @@ if (self.dht) self._createDHT(self.dhtPort)

}
debug('setTorrent %s', torrent)
debug('setTorrent %s', self.infoHash)
// If tracker exists, then it was created with just infoHash. Set torrent length
// so client can report correct information about uploads.
if (self.tracker && self.tracker !== true)
if (self.tracker && self.tracker !== true) {
self.tracker.torrentLength = torrent.length
else
} else {
self._createTracker()
}

@@ -60,0 +66,0 @@ if (self.dht) {

{
"name": "torrent-discovery",
"description": "Discover BitTorrent peers via DHT and Trackers",
"version": "2.2.0",
"version": "2.2.2",
"author": {

@@ -28,2 +28,3 @@ "name": "Feross Aboukhadijeh",

"hat": "0.0.3",
"standard": "^3.1.2",
"tape": "^3.5.0"

@@ -52,4 +53,4 @@ },

"scripts": {
"test": "tape test/*.js"
"test": "standard && tape test/*.js"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc