prerouting

0.5.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i prerouting

Weekly Downloads

0

Version

0.5.0

License

GPL-3.0

Last publish

Collaborators

  • hex7c0