How to use the network.get_private_ip function in network

To help you get started, we’ve selected a few network examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prey / prey-node-client / lib / agent / providers / network / index.js View on Github external
common = require('../../common'),
    status = require('./../../triggers/status'),
    logger = common.logger.prefix('network'),
    config = common.config,
    needle = require('needle');

var ap_list_callbacks = [],
    getting_ap_list   = false;

/////////////////////////////////////////////////////////////////
// getters
/////////////////////////////////////////////////////////////////

exp.get_public_ip = network.get_public_ip;

exp.get_private_ip = network.get_private_ip;

exp.get_gateway_ip = network.get_gateway_ip;

exp.get_active_network_interface = network.get_active_interface;

/////////////////////////////////////////////////////////////////
// wifi getters
/////////////////////////////////////////////////////////////////

/**
 * Callsback an array of wireless interface names
 **/
exp.get_wireless_interfaces_list = os_functions.get_wireless_interfaces_list;

exp.get_active_access_point_mac = os_functions.get_active_access_point_mac;
github fttx / barcode-to-pc-server / electron / main.js View on Github external
}).on('getDefaultAddress', (event, arg) => {
        network.get_private_ip((err, ip) => {
            ipcClient.send('getDefaultAddress', ip);
        });
    }).on('getHostname', (event, arg) => {
        ipcClient.send('getHostname', os.hostname());
github ipfs / js-ipfs / src / routing / index.js View on Github external
self.start = function (cb) {
    network.get_private_ip(function (err, ip) {
      if (err) {
        cb(err)
      }
      var multiaddrs = []
      multiaddrs.push(new Multiaddr('/ip4/' + ip + '/tcp/' + 4001))
      self.peer = new Peer(Id.create(), multiaddrs)
      self.useRouterDHT()
      self.useDiscoveryMDNS()
      if (cb) {
        cb()
      }
    })
  }
github fttx / barcode-to-pc-server / electron / src / handlers / connection.handler.ts View on Github external
}).on('getDefaultLocalAddress', (event, arg) => {
                network.get_private_ip((err, ip) => {
                    event.sender.send('defaultLocalAddress', ip);
                });
            }).on('getHostname', (event, arg) => {
                event.sender.send('hostname', os.hostname());