tcp->websocket proxy
NAME:
postmistress serve
USAGE:
postmistress serve
OPTIONS:
--tcp-address string address to bind to for incoming tcp requests [$TCP_ADDRESS]
--tcp-target string websocket server to forward tcp requests to [$TCP_TARGET]
--ws-address string address to bind to for websocket requests [$WS_ADDRESS]
--auth string auth string to forward to websocket and check for in incoming websocket requests [$AUTH]
--help, -h show help-
binds to
tcp-addressand accepts incoming tcp connectionsfor every incoming tcp connection
- connects to
ws-targetover http websocket - sends
authasAuthorizationheader (ifauthis set) - joins tcp stream and websocket stream
- connects to
-
binds to
ws-addressand accepts incoming websocket connectionsfor every incoming websocket connection to
/connect?target=<tcp-target>- rejects if
authis set and does not matchAuthorizationheader - connects to
tcp-targetquery parameter over tcp - joins tcp stream and websocket stream
- rejects if
-
(
tcp->ws) forwarding smtp address:25to remote handlerwss://my-ws-handler.com/handleryou will obviously need to write the handler yourself
TCP_ADDRESS=:25 TCP_TARGET=wss://my-ws-handler.com/handler AUTH=mysecretpassword # important for security reasons, you must check for this in your handler -
(
ws->tcp) forwarding to remote smtp server1.2.3.4:25from websocket server:8080WS_ADDRESS=:8080 # AUTH=client must connect to
ws://localhost:8080/connect?target=1.2.3.4:25over websocket and provideAUTHinAuthorizationheader if set. -
(hacky:
tcp->tcp) forwarding smtp port:25to remote smtp server1.2.3.4:25WS_ADDRESS=:8080 # any available port is fine, as long as this matches port in `TCP_TARGET` TCP_ADDRESS=:25 TCP_TARGET=ws://localhost:8080/connect?target=1.2.3.4:25 # AUTH= # this wont do much here, tcp server forwards the same to websocket server which is checked to the same string