Merge pull request #119 from rogerdz/fix-announced-ip
fix announcedIp in network mode host
هذا الالتزام موجود في:
@@ -5,14 +5,16 @@ const ifaces = os.networkInterfaces();
|
|||||||
|
|
||||||
const getLocalIp = () => {
|
const getLocalIp = () => {
|
||||||
let localIp = '127.0.0.1';
|
let localIp = '127.0.0.1';
|
||||||
|
let checkIp = true;
|
||||||
Object.keys(ifaces).forEach((ifname) => {
|
Object.keys(ifaces).forEach((ifname) => {
|
||||||
for (const iface of ifaces[ifname]) {
|
for (const iface of ifaces[ifname]) {
|
||||||
// Ignore IPv6 and 127.0.0.1
|
// Ignore IPv6 and 127.0.0.1
|
||||||
if (iface.family !== 'IPv4' || iface.internal !== false) {
|
if (iface.family !== 'IPv4' || iface.internal !== false || checkIp === false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Set the local ip to the first IPv4 address found and exit the loop
|
// Set the local ip to the first IPv4 address found and exit the loop
|
||||||
localIp = iface.address;
|
localIp = iface.address;
|
||||||
|
checkIp = false
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم