1. function getIPAdress(){
    2. var interfaces = require('os').networkInterfaces();
    3. for(var devName in interfaces){
    4. var iface = interfaces[devName];
    5. for(var i=0;i<iface.length;i++){
    6. var alias = iface[i];
    7. if(alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal){
    8. return alias.address;
    9. }
    10. }
    11. }
    12. }