All Projects → Aldaviva → local-ipv4-address

Aldaviva / local-ipv4-address

Licence: Apache-2.0 License
Get the LAN IPv4 address of the local machine based on the default gateway

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to local-ipv4-address

private-ip
Check if IP address is private.
Stars: ✭ 26 (+85.71%)
Mutual labels:  lan, ip-address
CSArp-Netcut
An arpspoof program using Sharppcap
Stars: ✭ 93 (+564.29%)
Mutual labels:  lan
ipapi-python
Python bindings for https://ipapi.co (IP Address Location) - Use with python / django / flask for IP address location lookup
Stars: ✭ 42 (+200%)
Mutual labels:  ip-address
portsscan
A web client port-scanner written in GO, that supports the WASM/WASI interface for Browser WebAssembly runtime execution.
Stars: ✭ 68 (+385.71%)
Mutual labels:  localhost
ipaddress
Data analysis of IP addresses and networks
Stars: ✭ 20 (+42.86%)
Mutual labels:  ip-address
Report-IP-hourly
📬 Report Linux IP by email hourly.
Stars: ✭ 43 (+207.14%)
Mutual labels:  ip-address
flask-ipblock
Block certain IP addresses from accessing your Flask app
Stars: ✭ 14 (+0%)
Mutual labels:  ip-address
findip
🔧 Python Script For Finding All Available Local IP Addresses
Stars: ✭ 38 (+171.43%)
Mutual labels:  ip-address
portless
Easy local domains with superpowers
Stars: ✭ 106 (+657.14%)
Mutual labels:  localhost
adblock2privoxy
Convert adblock config files to privoxy format
Stars: ✭ 78 (+457.14%)
Mutual labels:  lan
Geolocate-IP-Browser-Extension
A browser extension, which shows you the origin of your IP address.
Stars: ✭ 21 (+50%)
Mutual labels:  ip-address
ssloca
Bash script that removes the headache of generating and trusting SSL certificates for localhost projects in macOS
Stars: ✭ 33 (+135.71%)
Mutual labels:  localhost
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+1414.29%)
Mutual labels:  ip-address
magic-home
A .NET library that imports functionality from the Magic Home app, allowing control of smart lights.
Stars: ✭ 23 (+64.29%)
Mutual labels:  lan
Hostess.swift
A Swift implementation of NSHost that works on iOS, OS X and tvOS. Hostess.swift is safe to use in a framework because it does not require a bridging header. Hostess is Swift 4.0 (or newer) only and replaces the Swift 2.x only Host.swift.
Stars: ✭ 27 (+92.86%)
Mutual labels:  ip-address
easylist-pac-privoxy
EasyList Tracker and Adblocks to Proxy Auto Configuration (PAC) File and Privoxy Actions and Filters
Stars: ✭ 99 (+607.14%)
Mutual labels:  lan
IP2Location-PHP-Module
This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
Stars: ✭ 154 (+1000%)
Mutual labels:  ip-address
SonyAPILib
Sony Smart Device C# API Library for remote control
Stars: ✭ 52 (+271.43%)
Mutual labels:  lan
WhereIsMyPi
A simple tool to find my raspberry pi on my LAN
Stars: ✭ 30 (+114.29%)
Mutual labels:  lan
landscaper
Apply code mods to projects, awesomely
Stars: ✭ 15 (+7.14%)
Mutual labels:  localhost

local-ipv4-address

Get the local network IPv4 address of the current computer based on the default gateway.

All of the other Node.js modules I found picked the address of the first or a random external interface from os.networkInterfaces() or performed a DNS lookup on the hostname. What if I have VMware virtual interfaces, an OpenVPN connection, wifi, an ethernet cable, and some loopback interfaces with convincing-looking hosts entries all connected?

Under the hood, it just executes route.exe or netstat and parses the output with regular expressions.

Installation

$ npm install --save local-ipv4-address

Usage

In a Node module

var localIpV4Address = require("local-ipv4-address");

localIpV4Address().then(function(ipAddress){
    console.log("My IP address is " + ipAddress);
    // My IP address is 10.4.4.137
});

On the command line

$ node node_modules/local-ipv4-address
10.4.4.137

Platform support

Operating System Versions tested
FreeBSD 11.0
Linux Debian 8.7 Jessie
Mac OS 10.12.4 Sierra
Windows 7, Server 2016

What's not handled

  • WAN address
  • IPv6
  • Multiple gateways
  • Multi-homed connections
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].