Skip to content
 
 

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UPnP TS

Port mapping via UPnP APIs

Installation

npm i @rejetto/nat-upnp

Usage

// using ES modules
import { Client } from "@rejetto/nat-upnp";
const client = new Client();

// using node require
const upnp = require("@rejetto/nat-upnp");
const client = new upnp.Client();

client
  .createMapping({
    public: 12345,
    private: 54321,
    ttl: 10,
  })
  .then(() => {
    // Will be called once finished
  })
  .catch(() => {
    // Will be called on error
  });

async () => {
  await client.removeMapping({
    public: 12345,
  });
};

client.getMappings();

client.getMappings({
  local: true,
  description: "both of these fields are optional",
});

client.getPublicIp();

About

NodeJS promise-based UPnP client with typescript.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages