npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

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

install

npm i prerouting

Downloadsweekly downloads

27

version

0.5.0

license

GPL-3.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability