http-port-forward
v2.0.3
Published
Simple port forward for incoming HTTP requests, cross-platform supported base on Node.js
Downloads
121
Maintainers
Readme
Simple port forward for incoming HTTP requests, cross-platform supported base on Node.js.
Installation
$ npm install http-port-forward
Quick Start
Use the code below to create a file named sample.js
var forward = require('http-port-forward');
// forward all local 1088 port http requests to 88 port.
forward(1088, 88);
Run by Node.js
. If you forward to port less than 1024 on Mac/Linux, you may need execute node by sudo
$ sudo node sample.js
Now you can use http://localhost:88
to visit the page on http://localhost:1088
API
forward(portForm, portTo, options)
- portForm
Number
- Required, port NO. which you want to forward from - portTo
Number
- Required, port NO. which you want to forward to - options
Object
- Optional, options Config object passed to the forward - options.isPublicAccess
Boolean
- Optional, if true the new port will be accessible for others
License
MIT(LICENSE)