Returns the internal IP address.
const WebpackDevServer = require("webpack-dev-server");
const logInternalIPs = async () => {
const localIPv4 = WebpackDevServer.findIp("v4", false);
const localIPv6 = WebpackDevServer.findIp("v6", false);
console.log("Local IPv4 address:", localIPv4);
console.log("Local IPv6 address:", localIPv6);
};
logInternalIPs();Use the following command to run this example:
node app.js- The script should log your local IPv4 and IPv6 address.