Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocat does not report errors when the connection dies #237

Open
the-sun-will-rise-tomorrow opened this issue Apr 18, 2024 · 1 comment

Comments

@the-sun-will-rise-tomorrow

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.

@vi
Copy link
Owner

vi commented Apr 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants