multiwebsock2tcp

0.3.6 • Public • Published

multiWebsock2Tcp

================= MultiWebsock2Tcp is a sort of multi webscocket to tcp bridge server.

Its intended to use in conjunction with noVNC.

It can also use certs to create a cecure connection to to noVNC.

Installing

git clone https://github.com/timhaak/multiWebsock2Tcp
cd multiWebsock2Tcp
npm install

Running

To start the server just run

node index.js

By defaul the server will be listening on port 3000

Options

You can pass a couple options to the server Use To set web server port --port

To preserver websocket connection setup between restarts --preserve

To enable wss:// --key key.pem --cert cert.pem

You can genreate test cert and key by running

openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout key.pem

If you would like to load a diffrent initial websocket config file. --preserveFile file or have a file called ./CurrentConnections.js

By default you can only connect from 127.0.01

To set the ip that you are allowed to connect to the server on use --ips ip1,ip2

Examples

Add a connection

Do a post request to http://127.0.0.1:3000/ws?src_ip=192.168.100.5&local_port=2333&remote_ip=10.10.10.10&remote_port=5900

This will create a tunnel listening on port 2333 connected to 10.10.10.10 and port 5900. It will also only accept connections from 192.168.100.5. It will also return a list of the current connections.

.ie

{
    "1": {
        "src_ip": "192.168.100.5",
        "local_port": 2333,
        "remote_ip": "10.10.10.10",
        "remote_port": 5900,
        "created": "2014-02-06T17:28:29+02:00",
        "updated": "2014-02-06T17:28:29+02:00"
    }
}

To delete a connection

Do a delete request to http://127.0.0.1:3000/ws?id=1

To list connections

Do a get request to http://127.0.0.1:3000/ws

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.6
    2
    • latest

Version History

Package Sidebar

Install

npm i multiwebsock2tcp

Weekly Downloads

5

Version

0.3.6

License

MIT

Last publish

Collaborators

  • timhaak