Socket
Socket
Sign inDemoInstall

external-ip

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

external-ip

Get your external IP, with fallbacks


Version published
Weekly downloads
2.2K
decreased by-7.81%
Maintainers
1
Weekly downloads
 
Created
Source

#external-ip

Build Status

XKCD 865

Get your external IP, with fallbacks

##Installation

npm install external-ip

##Test Change your working directory to the project's root, npm install to get the development dependencies and then run npm test

##Usage

basic

'use strict';

var getIP = require('../index')();

getIP(function (err, ip) {
    if (err) {
        // every service in the list has failed
        throw err;
    }
    console.log(ip);
});

with configuration

'use strict';

var extIP = require('../index');

var getIP = extIP({
    replace: true, // true: replace the default services list, false: extend it, default: false
    services: ['http://ifconfig.co/x-real-ip', 'http://ifconfig.me/ip'],
    timeout: 600 // set timeout per request, default: 500ms
});

getIP(function (err, ip) {
    if (err) {
        throw err;
    }
    console.log(ip);
});

##Why? No idea, really. Just another lib that gives you your external ip address

##Todo:

  • clean up some mess
  • sequential / parallel (spam) requests ?

Keywords

FAQs

Package last updated on 17 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc