Skip to content

nggit/node-protocol-multiplexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Protocol Multiplexer

A simple tool to serve multiple services on the same port. Written in Node.js with zero dependencies.

This program can be used to share a public port for multiple services (on private/different ports). The private port will be selected based on the "signature" of the first packet received. Whether it's HTTP, SSH, or etc.

                  ____ 127.0.0.1:22
                 |
0.0.0.0:2222 ____|____ 127.0.0.1:80
                 |
                 |____ 127.0.0.1:443

I know there are programs available out there for this purpose such as sslh. This is here solely for educational purposes.

Configuration

Just edit the .env file.

Usage

There are several ways to run this program. Please use run.sh as an entry point instead of running node server.js directly to have the .env file loaded:

sh run.sh

If you have npm:

npm start

Alternatively, it's quite common to run it by calling run.sh file directly. Make sure to make the run.sh file executable:

chmod +x run.sh

And to run it:

./run.sh

If you want to run it in the background:

./run.sh &

Run in the background super-silently (detached, without any output):

( ./run.sh > /dev/null 2>&1 & )

About

A simple tool to serve multiple services on the same port. Written in Node.js with zero dependencies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published