-
Notifications
You must be signed in to change notification settings - Fork 276
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 doesn’t shut down when the server shuts down immediately #63
Comments
Does it still happen if you also specify Unfortunately, current Websocat tends to ignore incoming RST, FIN or WebSocket close messages. |
Ah, yes. Sorry, I didn’t see that flag and thought that would be default behavior. Thank you! |
FWIW I’m unclear about what precisely that flag is meant to do differently. I find that EOF on STDIN closes the connection even when I don’t give that flag. So as far as I can tell, the only thing this flag changes is to make websocat terminate when the remote initiates the shutdown … which seems like it would be always desirable … ? |
Default behaviour for interactive/simple (one-argument) mode may indeed be changed. This probably needs splitting EOF on stdin may not actually close the connection immediately without For example, |
according to the rfc
it seems websocat did not send a close frame response when the server sent a close frame first (i did not dig into the websocat's source code, instead, i found the missing in the server's log) @vi
i also tried same operations in firefox's console |
Looks like a peculiarity of the current implementation of |
omg, that's true. I had to check in Postman to make sure the server does send the close event. |
You are right, it does not, which is a violation of the specs. I opened |
I’ve got an application where the server will close the WS session immediately after the handshake with 1008 (policy violation) depending on certain query string parameters in the URL.
When this happens, websocat hangs. The last few lines of debug output are:
If I hit CTRL-D, then websocat will end the connection.
What may be going on is that websocat reacts badly to the server’s having already closed the TCP connection … which I’m guessing is what prompts the
BrokenPipe
. While this may be counter to the WS specification, websocat ought not to hang in response to it.wscat2 (https://www.npmjs.com/package/wscat2) handles this case correctly.
The text was updated successfully, but these errors were encountered: