Open Foster024 opened 3 years ago
It is likely cannot be done with just a simple launch parameters.
Although websocat can sort-of-forward one WebSocket connection into another (e.g. something like websocat ws-l:127.0.0.1:1234 ws://echo.websocket.org
), it does not preserve many parameters and work only for one URL, making it a poor choice for a transparent proxy.
Inspecting packets as they pass though can probably be done with socat -v -x
used in combination with a pair of Websocats (one for server, one for client).
If you need more reliable solution, you'll probably need to enhance support of WebSockets in mitmproxy or something like that.
websocat -t ws-l:127.0.0.1:1234 reuse-raw:- | websocat ws://echo.websocket.org -vv
Why i can't see response in client window after connect 127.0.0.1:1234? I see response in "proxy-server" window.
PS: only 1 URL i need working
The |
pipe between the two websocats is unidirectional.
You need to combine Websocats in a bidirectional way for this to work.
For example:
websocat -E -t ws-l:127.0.0.1:1234 reuse-raw:exec:websocat --exec-args ws://echo.websocket.org -vv
Hey. Please help me with the launch parameters of the program. I want to use websocat for programs running locally on my computer, as a proxy server for https-wss on the global Internet. 1) I want to see in the console the contents of packets that pass through the proxy server 2) I want to pass data from websocat to another package editing program. I want to use tcp ip connection or read / write to local file. This is needed to carry out an attack like MITM.