0.5.0 • Published 8 years ago
prerouting v0.5.0
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 preroutingor
git clone git://github.com/hex7c0/prerouting.gitAPI
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