websocat icon indicating copy to clipboard operation
websocat copied to clipboard

websocat does not report errors when the connection dies

Open the-sun-will-rise-tomorrow opened this issue 1 year ago • 1 comments

I'm trying to use websocat to debug a network problem with websockets.

Here is an excerpt from running with -v:

[INFO  websocat::ws_peer] Received WebSocket ping
[INFO  websocat::ws_peer] Received WebSocket ping
[INFO  websocat::ws_peer] Received WebSocket ping
[INFO  websocat::ws_peer] Received WebSocket ping

and then, nothing.

Is the other side not sending ping frames? If so, shouldn't websocat do something, like send its own ping frames, and detect a timeout?

Has the connection been terminated by a FIN or RST? If so, shouldn't websocat print an error message?

If I press Enter, then it exits with websocat: WebSocketError: I/O failure, but it doesn't explain much (#236).

Thanks.

If you want Websocat to send pings, use --ping-interval (and maybe --ping-timeout) options. Note that it would send the pings constantly, regardless of incoming data or pings.


Connection termination (especially in the default interactive mode) is indeed a problem in Websocat. Sometimes I need to type two additional messages before it detects that the connection is no longer usable. -E option may help, but may also introduce other problems. --async-stdio likewise can improve latency, but cause other problems.


Related issue about usefulness of Websocat's log messages: #209.

vi avatar Apr 18 '24 21:04 vi