MCPcopy
hub / github.com/ajaxorg/ace / getLocalIps

Function getLocalIps

static.js:154–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152}
153
154function getLocalIps() {
155 var os = require("os");
156
157 var interfaces = os.networkInterfaces ? os.networkInterfaces() : {};
158 var addresses = [];
159 for (var k in interfaces) {
160 for (var k2 in interfaces[k]) {
161 var address = interfaces[k][k2];
162 if (address.family === "IPv4" && !address.internal) {
163 addresses.push(address.address);
164 }
165 }
166 }
167 return addresses;
168}
169
170console.log("http://" + (ip == "0.0.0.0" ? getLocalIps()[0] : ip) + ":" + port);
171

Callers 1

static.jsFile · 0.85

Calls 2

pushMethod · 0.80
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…