From 9de7d807d208bd20ab6d86ec5ab1de61a3a2c28e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 30 Dec 2015 23:13:06 +0000 Subject: [PATCH] incremental update --- README.md | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dbefe71..66a1646 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,9 @@ npm install --global holepunch npm install --save holepunch ``` -## Commandline (CLI) +## Examples + +### Commandline (CLI) ```bash holepunch --help @@ -40,6 +42,39 @@ holepunch --help holepunch --plain-ports 80,65080 --tls-ports 443,65443 ``` +### API + +```javascript +var punch = require('holepunch'); + +punch({ + debug: true +, plainPorts: [{ internal: 80, external: 80 }] +, tlsPorts: [{ internal: 443, external: 443 }] +, ipifyUrls: ['api.ipify.org'], +, protocols: ['none', 'upnp', 'pmp'] +, rvpnConfigs: [] +}).then(function () { +}); +``` + +## API + +```javascript +punch(opts) + debug // print extra debug info + + tcpPorts // these ports will be tested via tcp / http + + tlsPorts // these ports will be tested via tls / https + + udpPorts // not implemented, not tested + + loopback // test ports via http / https +``` + +## Commandline + TODO `--prebound-ports 22` ``` @@ -68,12 +103,6 @@ Options: -h, --help Display help and usage details ``` -## API - -```javascript -var punch = require('holepunch'); -``` - ## Non-Root You **do not need root** to map ports, but you may need root to test them.