node-portmapping
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

Multi-protocol NAT Port Mapping for Node.js

License: MPL 2.0 NPM package

node-portmapping allows to forward ports on Network Address Translators (NAT). It implements the protocols PCP, NAT-PMP, and UPnP, and automatically detects which one to use.

This project consists in Node.js bindings for libplum, which is licensed under MPL 2.0.

Example

const nodePortMapping = require('node-portmapping');

nodePortMapping.init();

const mapping = nodePortMapping.createMapping(8080, (info) => {
    if (info.state == 'Success') {
        console.log(`${info.externalHost}:${info.externalPort}`);
    }
});

Install

$ npm install node-portmapping

Package Sidebar

Install

npm i node-portmapping

Weekly Downloads

1

Version

0.3.1

License

MPL-2.0

Unpacked Size

35.5 kB

Total Files

16

Last publish

Collaborators

  • paullouisageneau