prerouting
v0.5.0
Published
preroute incoming traffic to another TCP server
Downloads
10
Readme
prerouting
Preroute incoming traffic to N TCP servers; for compress data, encrypt message, etc (or just a loop :D)
request
|
+
+----------------+
| 5001 -> 5000 |
+----------------+
+
|
compression
|
+
+----------------+
| 5000 -> 3000 |
+----------------+
+
|
decompression
|
+
+----------------+
| 3000 |
+----------------+
Installation
Install through NPM
npm install prerouting
or
git clone git://github.com/hex7c0/prerouting.git
API
inside nodejs project
var prerouting = require('prerouting');
var server = prerouting.createServer();
createServer(options)
options
toPort
- Number connect to this port (default "3000")toHost
- String connect to this host (default "127.0.0.1")listenPort
- Number open a TCP server on this port (default "5000")listenHost
- String open a TCP server on this host (default "127.0.0.1")dataToNext
- Function function to next route (default "false")dataFromNext
- Function function from next route (default "false")tls
- Object Enable TLS server (default "false")clientUseTls
- Boolean connect to TLS client (default "false")
NET options
TLS options
Examples
Take a look at my examples