hyperswarm
Advanced tools
Comparing version 4.6.1 to 4.7.0
16
index.js
@@ -25,2 +25,3 @@ const { EventEmitter } = require('events') | ||
seed, | ||
relayThrough, | ||
keyPair = DHT.keyPair(seed), | ||
@@ -40,3 +41,4 @@ maxPeers = MAX_PEERS, | ||
this.server = this.dht.createServer({ | ||
firewall: this._handleFirewall.bind(this) | ||
firewall: this._handleFirewall.bind(this), | ||
relayThrough: this._maybeRelayConnection.bind(this) | ||
}, this._handleServerConnection.bind(this)) | ||
@@ -50,2 +52,4 @@ | ||
this.maxParallel = maxParallel | ||
this.relayThrough = relayThrough || null | ||
this.connecting = 0 | ||
@@ -76,2 +80,7 @@ this.connections = new Set() | ||
_maybeRelayConnection () { | ||
if (!this.relayThrough) return null | ||
return this.relayThrough() | ||
} | ||
_enqueue (peerInfo) { | ||
@@ -155,7 +164,10 @@ if (peerInfo.queued) return | ||
const relayThrough = this._maybeRelayConnection() | ||
const conn = this.dht.connect(peerInfo.publicKey, { | ||
relayAddresses: peerInfo.relayAddresses, | ||
keyPair: this.keyPair | ||
keyPair: this.keyPair, | ||
relayThrough | ||
}) | ||
this._allConnections.add(conn) | ||
this.connecting++ | ||
@@ -162,0 +174,0 @@ this._clientConnections++ |
{ | ||
"name": "hyperswarm", | ||
"version": "4.6.1", | ||
"version": "4.7.0", | ||
"description": "A distributed networking stack for connecting peers", | ||
@@ -12,3 +12,3 @@ "files": [ | ||
"events": "^3.3.0", | ||
"hyperdht": "^6.6.0", | ||
"hyperdht": "^6.7.0", | ||
"safety-catch": "^1.0.2", | ||
@@ -15,0 +15,0 @@ "shuffled-priority-queue": "^2.1.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
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
36111
810
Updatedhyperdht@^6.7.0