Comparing version 6.8.8 to 6.8.9
@@ -105,3 +105,3 @@ const NoiseSecretStream = require('@hyperswarm/secret-stream') | ||
// we haven't hole punched yet and the other side is just sending us traffic through the relay. | ||
if (c.relaySocket && c.relaySocket.rawStream && c.relaySocket.rawStream.socket === socket) { | ||
if (c.relaySocket && isRelay(c.relaySocket, socket, port, host)) { | ||
return false | ||
@@ -753,2 +753,9 @@ } | ||
function isRelay (relaySocket, socket, port, host) { | ||
const stream = relaySocket.rawStream | ||
if (!stream) return false | ||
if (stream.socket !== socket) return false | ||
return port === stream.remotePort && host === stream.remoteHost | ||
} | ||
function noop () {} |
@@ -210,3 +210,3 @@ const { EventEmitter } = require('events') | ||
// we haven't hole punched yet and the other side is just sending us traffic through the relay. | ||
if (hs.relaySocket && hs.relaySocket.rawStream && hs.relaySocket.rawStream.socket === socket) { | ||
if (hs.relaySocket && isRelay(hs.relaySocket, socket, port, host)) { | ||
return false | ||
@@ -617,2 +617,9 @@ } | ||
function isRelay (relaySocket, socket, port, host) { | ||
const stream = relaySocket.rawStream | ||
if (!stream) return false | ||
if (stream.socket !== socket) return false | ||
return port === stream.remotePort && host === stream.remoteHost | ||
} | ||
function noop () {} |
{ | ||
"name": "hyperdht", | ||
"version": "6.8.8", | ||
"version": "6.8.9", | ||
"description": "The DHT powering Hyperswarm", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
133703
3731