Check that a given IP Address is private.
npm install is-local-ipvar isLocal = require('is-local-ip');
isLocal("127.0.0.1"); // true
isLocal("::ffff:127.0.0.1"); // true
isLocal("192.168.0.12"); // true
isLocal("184.55.123.2"); // false::::1fc00::/7fe80::/1010.0.0.0-10.255.255.255127.0.0.0-127.255.255.255169.254.1.0-169.254.254.255172.16.0.0-172.31.255.255192.168.0.0-192.168.255.255
- Use
npm testto run tests.
Please feel free to create a PR!