diff --git a/lib/server.ts b/lib/server.ts index 7578c112..56d325b7 100644 --- a/lib/server.ts +++ b/lib/server.ts @@ -64,12 +64,15 @@ function allAddresses (type): string[] { family = 'IPv6' } const addresses: string[] = [] + const macs: string[] = [] const interfaces = os.networkInterfaces() for (const ifname in interfaces) { if (ifname in interfaces) { interfaces[ifname]?.forEach((a) => { - if (a.family === family) { + // Checking for repeating MAC address to avoid trying to listen on same interface twice + if (a.family === family && !macs.includes(a.mac)) { addresses.push(a.address) + macs.push(a.mac) } }) }