实现代码: 代码如下:var os = require(‘os’);function getLocalIP() { var map = []; var ifaces = os.networkInterfaces(); console.log(ifaces);
for (var dev in ifaces) { if (dev.indexOf(‘eth0’) != -1) { var tokens = dev.split(‘:’); var dev2 = null; if (tokens.l
2023-12-05 15:23:31
19KB
ip
1