How does electron-vue get client ip

how does electron-vue get client ip


install dependent npm install ip first

add
const ip = require ('ip') to the code;
const IPAddress = ip.address ();
console.log (IPAddress);


let interfaces = require ('os'). NetworkInterfaces ();

        for (let devName in interfaces) {
            let iface = interfaces[devName];
            for (let i = 0; i < iface.length; iPP) {
                let alias = iface[i];
                if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
                    this.Ip=alias.address
                }
            }
        }
        
       
Menu