Websocket to TCP tunnel
npm install websocket-to-tcp
npm i -g websocket-to-tcp
`
This installs the utility in the global register that
can be called from the command line interface with wstcp.
Usage
`
wstcp -t tcpaddress -p tcpport -w wsport [-n name] [--usestrings] [--key key.pem --cert cert.pem]
`
tcpaddress is the address of the remote TCP connection
tcpport is the port number of the remote TCP connection
wsport the websocket listening local port number
name (optional) the name of websocket sub-protocol
usestrings (optional) send data as strings instead of binary bytes (needed for some WebSocket servers)
key (optional) specifies the key file for a WSS:// secure connection
cert (optional) specifies the certificate file for a WSS:// secure connection
Example
`
wstcp -t bbs.sblendorio.eu -p 6510 -w 8080 -n bbs
`
Creates a local server that accepts WebSocket connections on the port 8080
and forwards them to bbs.sblendorio.eu:6510. The name of the WebSocket
sub-protocol is bbs.
Multiple forward
It is possibile to create two or more "tunnels" per time, with wstcpm:
`
wstcpm -l \
host1.com,6510,8080,bbs,privkey.pem,cert.pem \
host2.com,6510,8081,bbs,privkey.pem,cert.pem
``