vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
7.17k stars 278 forks source link

Multiple Incoming messages #26

Open priyankn opened 5 years ago

priyankn commented 5 years ago

Good work on this project! I have one question though, does the client keeps the websocket channel open for new incoming messages?

I have a particular scenario where the for one 'outgoing' request, I have two 'incoming' responses from the server. I can see the first response, but not the second ( I see it via the browser). I suspect the channel is closed, but some clarification would be appreciated.

vi commented 5 years ago

Multiple incoming messages should be OK. By default each text message should turn into one line on stdout. Close is sent when stdin is closed (unless -n option is specified to websocat).

I can see the first response, but not the second

What do you see instead? Does it exits or just wait?

priyankn commented 5 years ago

Nothing, it just waits. The connection drops anyway after ~5 secs, so if I try to send the request again I see:

^@websocat: WebSocketError: I/O failure

Edit: I am using binary mode.

vi commented 5 years ago

Please show the command line.

Assuming it's Linux, please also prepare two logs like this:

RUST_LOG=debug websocat -b ws://your_server 2> log1.txt
strace -fe trace=network -o log2.txt websocat -b ws://your_server