nat-upnp-wrapper
v1.5.0
Published
A nat-upnp wrapper.
Downloads
7
Readme
#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));