Closed Martin-CF closed 2 months ago
I ran into the same problem.
the function allAddresses should not include network aliases. They can be identied by the mac address:
function allAddresses(type) { var _a; let family = 'IPv4'; if (type === 'udp6') { family = 'IPv6'; } var macs = [] const addresses = []; const interfaces = os_1.default.networkInterfaces(); for (const ifname in interfaces) { if (ifname in interfaces) { (_a = interfaces[ifname]) === null || _a === void 0 ? void 0 : _a.forEach((a) => { if (a.family === family && macs.includes(a.mac) == false) { addresses.push(a.address); macs.push(a.mac); } }); } } return addresses; }
I've added: https://github.com/coapjs/node-coap/pull/370
The device can be found normally by configuring a single IP for my network link. When multiple IP addresses are configured, the device cannot be found. How to solve this problem? Thank you for your help。