1.0.10 • Published 30 days ago

pubface v1.0.10

Weekly downloads
-
License
MIT-0
Repository
github
Last release
30 days ago

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

1.0.10

30 days ago

1.0.9

2 months ago

1.0.8

3 months ago

1.0.7

3 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago