nat-upnp-wrapper

1.5.0 • Public • Published

nat-upnp-wrapper

This is a wrapper for the nat-upnp module.

Script Usage

Map port

const mapper = require('nat-upnp-wrapper');
mapper.map(options).then(response => console.log(response.success));

Options:

{
    "port": 80, // or [public,private]
    "ports": [80,443,[8081,8082]], // takes priority
    "protocol": "UDP" // defaults to "TCP"
}

Unmap port

mapper.unmap(options).then(response => ...);

Options

{
    "port": 80,
    "ports": [80,443,8081],
    "protocol": "UDP"
}

Get Mappings

mapper.mappings(true).then(response => console.log(response.results));

Set to true for local results. Defaults to false.

Get Public IP Address

mapper.ip().then(ip => console.log(ip));

Readme

Keywords

Package Sidebar

Install

npm i nat-upnp-wrapper

Weekly Downloads

1

Version

1.5.0

License

MIT

Unpacked Size

4.5 kB

Total Files

4

Last publish

Collaborators

  • andrewrivers