tcp over websocket proxy written in rust
NOTE: currently wusp only supports one user and one proxy target, i made this to proxy ssh requests to my forgejo server so i dont really plan on adding more, but i might also i made this to learn rust so this is probably trash. if you want better functionality consider using jpillora/chisel
server is really simple, authentication is passed via Authorization header and websocket connection is established.
then any further websocket messaging is relayed to tcp and vice versa.
a new tcp connection is opened for every successful websocket connection.
wusp server <address> <target> --auth <auth>example:
# here wusp listens on port 8080 (on http) and proxies requests to ssh on 22, and only allows authorized clients
wusp server 127.0.0.1:8080 127.0.0.1:22 --auth super_secure_passwordnot passing the auth string will allow any client to connect.
the client is also really simple and binds stdin/stdout to remote tcp server.
wusp client <host> --auth <auth>example:
wusp client ws://127.0.0.1:8080 --auth super_secure_passwordfor client, host can be passed via WUSP_HOST.
for server, binding address can be passed via WUSP_ADDRESS, target can be passed via WUSP_TARGET.
for both commands auth is optional and can also be passed via WUSP_AUTH env var.
WUSP_AUTH=super_secure_password wusp client ws://127.0.0.1:8080im using clap so i believe cli arg would take precedence over env var
-
connecting to an ssh server over https
for me its cloudflare tunnels or other tunneling provider (cloudflare supports ssh but you need the big bad cloudflare client so its meh)
ssh -o ProxyCommand="wusp client wss://myserver.com --auth super_secure_password" myserver.comor you can have it in config (~/.ssh/config)
Host myserver.com ProxyCommand wusp client wss://myserver.com --auth super_secure_passwordnow you can simply do
ssh myserver.com
- option to bind client to a tcp port rather than stdin/stdout
- multiple targets/users
i dont know im new to rust but i made it pretty simple so read the source code
go wild with it, keep it simple tho. not that anyone will ever contribute :(
under MIT because im lazy to read through the others