#websocket #proxy #tcp

bin+lib wstcp

WebSocket to TCP proxy server

7 releases

0.2.0 May 10, 2020
0.1.5 Feb 6, 2020
0.1.4 May 19, 2018
0.1.1 Apr 23, 2018

#18 in WebSocket

Download history 60/week @ 2020-05-24 15/week @ 2020-05-31 10/week @ 2020-06-07 8/week @ 2020-06-14 14/week @ 2020-06-28 8/week @ 2020-07-05 16/week @ 2020-07-12 6/week @ 2020-07-19 7/week @ 2020-08-02 21/week @ 2020-08-09 8/week @ 2020-08-16 1/week @ 2020-08-23 14/week @ 2020-08-30 23/week @ 2020-09-06

131 downloads per month

MIT license

44KB
1K SLoC

wstcp

wstcp Documentation Build Status License: MIT

WebSocket to TCP proxy written in Rust.

Install

Precompiled binaries

A precompiled binary for Linux environment is available in the releases page.

$ curl -L https://github.com/sile/wstcp/releases/download/0.2.0/wstcp-0.2.0.linux -o wstcp
$ chmod +x wstcp
$ ./wstcp -h
wstcp 0.2.0
WebSocket to TCP proxy server

USAGE:
    wstcp [OPTIONS] <REAL_SERVER_ADDR>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --bind-addr <BIND_ADDR>    TCP address to which the WebSocket proxy bind [default: 0.0.0.0:13892]
        --log-level <LOG_LEVEL>     [default: info]  [possible values: debug, info, warning, error]

ARGS:
    <REAL_SERVER_ADDR>    The TCP address of the real server

Using Cargo

If you have already installed Cargo, you can install wstcp easily in the following command:

$ cargo install wstcp

Examples

Run wstcp in a terminal:

$ wstcp 127.0.0.1:3000
Apr 22 23:21:20.717 INFO Starts a WebSocket proxy server, server_addr: 127.0.0.1:3000, proxy_addr: 0.0.0.0:13892

Run a TCP server (in this example nc is used) in another terminal:

$ nc -l 127.0.0.1 -p 3000

Use ws to launch a WebSocket client:

$ ws ws://localhost:13892/
> foo # Enter "foo" and press the Enter key

After this, the "foo" string is displayed on the terminal running nc.

References

Dependencies

~7.5MB
~156K SLoC