fix: allow internal

libp2p should eventually handle listen versus announce addresses, this helps with ip6 support in the interim

License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Jacob Heun 2018-11-15 19:21:36 +01:00
parent 5f8571efb0
commit 537ebee0b4
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F

View File

@ -102,7 +102,7 @@ module.exports = (handler) => {
const netInterfaces = os.networkInterfaces()
Object.keys(netInterfaces).forEach((niKey) => {
netInterfaces[niKey].forEach((ni) => {
if (ni.family === 'IPv4' && !ni.internal) {
if (ni.family === 'IPv4') {
multiaddrs.push(
multiaddr(listeningAddr.toString().replace('0.0.0.0', ni.address))
)
@ -122,7 +122,7 @@ module.exports = (handler) => {
netInterfaces[niKey].forEach((ni) => {
if (ni.family === address.family) {
const maOpts = listeningAddr.toOptions()
if (maOpts.host === '::' && !ni.internal) {
if (maOpts.host === '::') {
maOpts.family = address.family
maOpts.address = ni.address
multiaddrs.push(