Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 621 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 621 Bytes

nat-traverse

NAT traversal by way of UPnP or NAT-PMP

Install

npm install -g nat-traverse

Command Line Usage

punch --private <port> --public <port> --ttl <secs>

API

nat(options, success, error)

Example

var nat = require('nat-traverse')

nat({
  type: 'udp', // tcp or udp - passed to nat-pmp
  private: 22,
  public: 8888,
  ttl: 3600,
  timeout: 3000
}, function(external) {
  console.log('Connected to WAN address: ' + external)
}, function(err) {
  console.log(err);
})