0.0.9 • Published 11 years ago

port-mux v0.0.9

Weekly downloads
11
License
-
Repository
github
Last release
11 years ago

node-port-mux

Multiplex multiple services through one (TCP) port.

How?

The muxer basically sniffs the initial data packet sent by the client to determine (using a rule set) where to forward the request to.

Install

npm install port-mux

Example

var Muxer = require('node-mux');

// instantiate Muxer
new Muxer()
  // match HTTP GET requests and forward them to localhost:80
  .add("GET ", 80)                                            // string
  // match TLS (HTTPS) requests (versions 3.{0,1,2,3})
  .add(/^\x16\x03(?:\x00|\x01|\x02|\x03)/, '192.168.1.1:443') // regex
  // you can also pass a matcher function:
  .add(function(chunk) {
    // - chunk is a Buffer
    // - if the function returns true, the match is considered a success.
  }, 1234)
  // start listening on port 3000
  .listen(3000);

LICENSE

Simplified BSD License ( BSD-2-Clause ).

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago