@libp2p/tcp
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -83,9 +83,14 @@ import net from 'net'; | ||
} | ||
// Because TCP will only return the IPv6 version | ||
// we need to capture from the passed multiaddr | ||
if (listeningAddr.toString().startsWith('/ip4')) { | ||
addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)); | ||
try { | ||
// Because TCP will only return the IPv6 version | ||
// we need to capture from the passed multiaddr | ||
if (listeningAddr.toString().startsWith('/ip4')) { | ||
addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)); | ||
} | ||
else if (address.family === 'IPv6') { | ||
addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)); | ||
} | ||
} | ||
else if (address.family === 'IPv6') { | ||
addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)); | ||
catch (err) { | ||
log.error('could not turn %s:%s into multiaddr', address.address, address.port, err); | ||
} | ||
@@ -92,0 +97,0 @@ return addrs.map(ma => peerId != null ? ma.encapsulate(`/p2p/${peerId}`) : ma); |
{ | ||
"name": "@libp2p/tcp", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -116,8 +116,12 @@ import net from 'net' | ||
// Because TCP will only return the IPv6 version | ||
// we need to capture from the passed multiaddr | ||
if (listeningAddr.toString().startsWith('/ip4')) { | ||
addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)) | ||
} else if (address.family === 'IPv6') { | ||
addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)) | ||
try { | ||
// Because TCP will only return the IPv6 version | ||
// we need to capture from the passed multiaddr | ||
if (listeningAddr.toString().startsWith('/ip4')) { | ||
addrs = addrs.concat(getMultiaddrs('ip4', address.address, address.port)) | ||
} else if (address.family === 'IPv6') { | ||
addrs = addrs.concat(getMultiaddrs('ip6', address.address, address.port)) | ||
} | ||
} catch (err) { | ||
log.error('could not turn %s:%s into multiaddr', address.address, address.port, err) | ||
} | ||
@@ -124,0 +128,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
65165
991
30
67
6
351