Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bcoin-org/bupnp

UPNP for node.js
https://github.com/bcoin-org/bupnp

Last synced: 6 days ago
JSON representation

UPNP for node.js

Awesome Lists containing this project

README

        

# bupnp

UPNP for node.js.

## Usage

``` js
const UPNP = require('bupnp');
```

## API

```javascript
// Set a timeout
UPNP.RESPONSE_TIMEOUT = 1000

// Discovering internet gateway (upnp)
let wan = await UPNP.discover()

// Find external IP (upnp)
let host = await wan.getExternalIP()

// Add port mapping (remoteHost, externalPort, internalPort)
await wan.addPortMapping(host, src, dest)

// Remove port mapping
await wan.removePortMapping(host, port)
```

## Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. ``

## License

- Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.