2.0.2 • Published 5 months ago

@ryanforever/pmp v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

pmp

Map ports using PMP (NAT Port Mapping Protocol)

This is a fork of nat-pmp. Added async/await and easier methods.

usage

const PMP = require("@ryanforever/pmp")
const pmp = new PMP({
    gateway: "192.168.1.1", // i.e. your router ip address
    ttl: 1800,              // amount of time in seconds port(s) should remain mapped
    ports: [69, 420],       // ports you want to map
    autoRefresh: true,      // automatically refresh port(s) before they expire
    description: "my-app",  // a description to be send along with the mapping
    debug: true,            // debug logging
})

// map the ports
pmp.map()

// unmap the ports
pmp.unmap()

You can also map the ports in the methods themselves

const PMP = require("@ryanforever/pmp")
const pmp = new PMP({
    gateway: "192.168.1.1",
    ttl: 1800
})

pmp.map(42)
pmp.unmap(42)
1.2.0

5 months ago

2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.2.1

5 months ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago