Skip to content

Resolve public network interfaces for current machine

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.txt
Unknown
license-report-config.json
Notifications You must be signed in to change notification settings

postalsys/pubface

Repository files navigation

pubface

Detect public network interfaces for current machine.

Usage as a module

Install the dependency

$ npm install pubface

Use it to get an array of interfaces

const { resolvePublicInterfaces } = require('pubface');
...
let interfaces = await resolvePublicInterfaces();
console.log(interfaces);

Usage as a command

Install the command

$ npm install -g pubface

Or alternatively download the latest executable if you do not have Node.js or NPM installed

Use it to get an array of interfaces

$ pubface

Output

Output is an array of interfaces:

[
  {
    "localAddress": "192.168.3.4",
    "ip": "1.2.3.4",
    "name": "ec2-1-2-3-4.eu-central-1.compute.amazonaws.com",
    "family": "IPv4",
    "defaultInterface": true
  },
  {
    "localAddress": "10.240.128.227",
    "ip": "101.102.103.104",
    "name": "104-103-102-101.sta.estpak.ee",
    "family": "IPv4"
  }
]
  • localAddress is the local IP address
  • ip is the public IP address that servers see as your IP address when you make a connection
  • name is the reverse record for ip
  • family is either IPv4 or IPv6 depending on the ip
  • defaultInterface is a boolean that indicates if this is the default interface used when making connections and not specifying a local address

License

Pubface is licensed under the MIT No Attribution license

About

Resolve public network interfaces for current machine

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.txt
Unknown
license-report-config.json

Stars

Watchers

Forks

Packages

No packages published