Skip to content
Permalink
Browse files
config: stop filtering out non-ipv4 addresses from local-addrs (#35)
Fixes: #986
PR-URL: #35
Credit: @valentin2105
Reviewed-By: @zkat
  • Loading branch information
valentin2105 authored and zkat committed Aug 3, 2018
1 parent af98e76 commit 84bfd23e7d6434d30595594723a6e1976e84b022
Showing with 3 additions and 12 deletions.
  1. +3 −12 lib/config/defaults.js
@@ -306,8 +306,6 @@ exports.types = {
key: [null, String],
'legacy-bundling': Boolean,
link: Boolean,
// local-address must be listed as an IP for a local network interface
// must be IPv4 due to node bug
'local-address': getLocalAddresses(),
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
logstream: Stream,
@@ -388,16 +386,9 @@ function getLocalAddresses () {
interfaces = {}
}

return Object.keys(interfaces).map(function (nic) {
return interfaces[nic].filter(function (addr) {
return addr.family === 'IPv4'
})
.map(function (addr) {
return addr.address
})
}).reduce(function (curr, next) {
return curr.concat(next)
}, []).concat(undefined)
return Object.keys(interfaces).map(
nic => interfaces[nic].map(({address}) => address)
).reduce((curr, next) => curr.concat(next), []).concat(undefined)
}

exports.shorthands = {

0 comments on commit 84bfd23

Please sign in to comment.