Socket
Socket
Sign inDemoInstall

hyperswarm

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperswarm - npm Package Compare versions

Comparing version 4.7.0 to 4.7.1

20

index.js

@@ -77,5 +77,5 @@ const { EventEmitter } = require('events')

_maybeRelayConnection () {
_maybeRelayConnection (force) {
if (!this.relayThrough) return null
return this.relayThrough()
return this.relayThrough(force)
}

@@ -161,3 +161,3 @@

const relayThrough = this._maybeRelayConnection()
const relayThrough = this._maybeRelayConnection(peerInfo.forceRelaying)
const conn = this.dht.connect(peerInfo.publicKey, {

@@ -190,3 +190,9 @@ relayAddresses: peerInfo.relayAddresses,

})
conn.on('error', noop)
conn.on('error', err => {
if (this.relayThrough && shouldForceRelaying(err.code)) {
peerInfo.forceRelaying = true
// Reset the attempts in order to fast connect to relay
peerInfo.attempts = 0
}
})
conn.on('open', () => {

@@ -505,1 +511,7 @@ opened = true

}
function shouldForceRelaying (code) {
return (code === 'HOLEPUNCH_ABORTED') ||
(code === 'HOLEPUNCH_DOUBLE_RANDOMIZED_NATS') ||
(code === 'REMOTE_NOT_HOLEPUNCHABLE')
}

1

lib/peer-info.js

@@ -23,2 +23,3 @@ const { EventEmitter } = require('events')

this.waiting = false
this.forceRelaying = false

@@ -25,0 +26,0 @@ // Set by the Swarm

{
"name": "hyperswarm",
"version": "4.7.0",
"version": "4.7.1",
"description": "A distributed networking stack for connecting peers",

@@ -5,0 +5,0 @@ "files": [

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