0.5.0 • Published 6 years ago

prerouting v0.5.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
6 years ago

prerouting

NPM version Linux Status Dependency Status Coveralls

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

License GPLv3

0.5.0

6 years ago

0.4.0

7 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago