"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const os = require("os");
class IPUtil {
    getLocalIP() {
        let ifaces = os.networkInterfaces();
        let result = '127.0.0.1';
        Object.keys(ifaces).forEach(function (ifname) {
            ifaces[ifname].forEach(function (iface) {
                if ('IPv4' !== iface.family || iface.internal !== false) {
                    return;
                }
                result = iface.address;
                return;
            });
        });
        return result;
    }
}
exports.default = new IPUtil();
//# sourceMappingURL=IPUtil.js.map