Comparing version 6.13.0 to 6.14.0
34
index.js
@@ -664,14 +664,30 @@ const { EventEmitter } = require('events') | ||
async * _resolveBootstrapNodes () { | ||
for (const node of this.bootstrapNodes) { | ||
let address | ||
try { | ||
address = await this.udx.lookup(node.host, { family: 4 }) | ||
} catch { | ||
continue | ||
for (let { host, port } of this.bootstrapNodes) { | ||
let doLookup = false | ||
if (host.indexOf('@') === -1) { | ||
doLookup = true | ||
} else { | ||
const [suggestedIP, fallbackHost] = host.split('@') | ||
try { | ||
await this.ping({ host: suggestedIP, port }) | ||
host = suggestedIP | ||
} catch { | ||
host = fallbackHost | ||
doLookup = true | ||
} | ||
} | ||
if (doLookup) { | ||
try { | ||
host = UDX.isIPv4(host) ? host : (await this.udx.lookup(host, { family: 4 })).host | ||
} catch { | ||
continue | ||
} | ||
} | ||
yield { | ||
id: peer.id(address.host, node.port), | ||
host: address.host, | ||
port: node.port | ||
id: peer.id(host, port), | ||
host, | ||
port | ||
} | ||
@@ -678,0 +694,0 @@ } |
{ | ||
"name": "dht-rpc", | ||
"version": "6.13.0", | ||
"version": "6.14.0", | ||
"description": "Make RPC calls over a Kademlia based DHT", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -113,3 +113,3 @@ # dht-rpc | ||
{ | ||
// A list of bootstrap nodes | ||
// A list of bootstrap nodes. Optionally prefix a suggested-IP, i.e. '192.168.1.10@bootstrap-node.com:24242' | ||
bootstrap: [ 'bootstrap-node.com:24242', ... ], | ||
@@ -116,0 +116,0 @@ // Optionally pass in array of { host, port } to add to the routing table if you know any peers |
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
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
63438
1455