dat-doctor
Advanced tools
Comparing version 1.2.0 to 1.2.1
22
index.js
@@ -24,3 +24,3 @@ var dnsDiscovery = require('dns-discovery') | ||
log('Could not resolve', doctor, 'skipping...') | ||
return startP2P() | ||
return startP2PDNS() | ||
} | ||
@@ -37,4 +37,4 @@ startPublicPeer(address) | ||
whitelist: [address], | ||
hash: false, | ||
announce: false | ||
dht: false, | ||
hash: false | ||
}) | ||
@@ -44,6 +44,6 @@ sw.on('error', function () { | ||
}) | ||
sw.listen(port) | ||
sw.listen(8765) | ||
sw.on('listening', function () { | ||
log('[info] Starting phase one (Public Server)') | ||
sw.join('dat-doctor-public-peer') | ||
sw.join('dat-doctor-public-peer', {announce: false}) | ||
sw.on('connecting', function (peer) { | ||
@@ -71,2 +71,3 @@ log('[info] Trying to connect to doctor, %s:%d', peer.host, peer.port) | ||
if (connected) return | ||
log('[info] Connection timeout, fail!') | ||
destroy() | ||
@@ -76,4 +77,4 @@ }, 10000) | ||
sw.destroy(function () { | ||
log('[info] End of phase one (Public Server), moving on to phase two (Peer to Peer)') | ||
startP2P() | ||
log('[info] End of phase one (Public Server), moving on to phase two (Peer to Peer via DNS)') | ||
startP2PDNS() | ||
cb() | ||
@@ -85,3 +86,3 @@ }) | ||
function startP2P () { | ||
function startP2PDNS () { | ||
var client = dnsDiscovery({ | ||
@@ -95,3 +96,4 @@ servers: defaults.dns.server | ||
servers: defaults.dns.server | ||
} | ||
}, | ||
dht: false | ||
}) | ||
@@ -130,3 +132,3 @@ | ||
if (buf.length === data.length) { | ||
log('[%s] Remote peer echoed expected data back', prefix) | ||
log('[%s] Remote peer echoed expected data back, success!', prefix) | ||
} | ||
@@ -133,0 +135,0 @@ }) |
{ | ||
"name": "dat-doctor", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Dat network doctor extension", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,4 @@ #!/usr/bin/env node | ||
}, | ||
hash: false | ||
hash: false, | ||
dht: false | ||
}) | ||
@@ -17,0 +18,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7041
185
3