blind-peer 2.7.6 → 2.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -155,7 +155,7 @@ class BlindPeer extends ReadyResource {
|
|
|
155
155
|
this.rocks = typeof rocks === 'string' ? new RocksDB(rocks) : rocks
|
|
156
156
|
this.store = store || new Corestore(this.rocks, { active: false })
|
|
157
157
|
this.swarm = swarm || null
|
|
158
|
-
this._port = port ||
|
|
158
|
+
this._port = port || 0
|
|
159
159
|
this.trustedPubKeys = new Set()
|
|
160
160
|
for (const k of trustedPubKeys || []) this.addTrustedPubKey(k)
|
|
161
161
|
|
|
@@ -213,7 +213,7 @@ class BlindPeer extends ReadyResource {
|
|
|
213
213
|
|
|
214
214
|
if (this.swarm === null) {
|
|
215
215
|
const swarmOpts = { keyPair: this.db.swarmingKeyPair }
|
|
216
|
-
if (this._port) swarmOpts.port = this._port
|
|
216
|
+
if (this._port) swarmOpts.port = typeof this._port === 'number' ? [this._port, this._port + 64] : this._port
|
|
217
217
|
this.swarm = new Hyperswarm(swarmOpts)
|
|
218
218
|
}
|
|
219
219
|
this.swarm.on('connection', this._onconnection.bind(this))
|