node-httptunnel a didirectional data stream tunnelled in standard HTTP requests (GET/PUT/POST/DELETE) written in node js.
This is a proof of concept, use it at your own risks
It supports mTLS between client and server or client -> reverse-proxy / reverse-proxy -> server. Useful to use non HTTP protocols (like ssh) through an HTTP reverse proxy (like otoroshi).
yarn install
For the following example let say we want to tunnel an ssh connection from machine A to machine B using only HTTP.
node src/client.js --remote 'http://xxx.xxx.xxx.xxx:8080' --port 2222
the client command supports the following options :
debug
: display debug logsremote
: remote server urladdress
: forwarded address, by default 127.0.0.1port
: forwarded port, by default 2222retries
: number of retries when http error occurs, by default 3caPath
: path for a ca cert filecertPath
: path for a client cert filekeyPath
: path for a client cert key file
node src/client.js --port 8080 --targetPort 22
the server command supports the following options :
debug
: display debug logsport
: http port, default is 8080;target
: target host and port, default is '127.0.0.1:22'timeout
: timeout in ms before releasing a read bytes connection, default is 10000;caPath
: path for a ca cert filecertPath
: path for a client cert filekeyPath
: path for a client cert key filerequestCert
: request client certrejectUnauthorized
: reject non client cert requests
ssh theuser@localhost -p 2222 # we use 2222 that is exposed by client.js
Password:
Last login: Thu Dec 20 13:37:00 2018 from 127.0.0.1
MyAwesomeMachineB:~ theuser$