-
Notifications
You must be signed in to change notification settings - Fork 272
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
Does not detect connection close in double-listen configuration #183
Comments
Specifying listeners on both parts is typically not a good idea. What do you want to do? Some things that may help:
Command line that works reasonably for me:
Note that port 5819 only starts being listened after the first WebSocket clients gets connected. |
Thanks very much for those overlays. I'd tried -E before with no luck, but using the options you suggested together seems to do the trick. What I'm doing is, specifically, https://nabu.run (https://youtu.be/zabJhYvoI1k). It may not be a good idea to listen on both parts, but it is exactly what I need. Being able to do that with websocat makes my application possible, and saves me having to write my own proxy. The situation I was trying to avoid was that if you clicked the "Connect WebSocket" button and then closed it or reloaded the page, it couldn't be used again. Not sure if there's still a bug worth fixing, but I feel like I have a reasonable workaround now. |
If you want to listen WebSocket from both sides then maybe you want to use wsbroad as a component. Websocat may still be needed to turn
|
Probably easier to demonstrate than explain. If you proxy a listening websocket to a listening TCP socket:
and then connect to the websocket and close the connection, it won't notice. Opening another connection results in:
If you connect to the TCP socket, it then immediately prints
This behavior doesn't occur if, for example, it's in plain server (
-s
) mode, or usingtcp:
,literalreply:
, etc. It seems specific to proxying to a listening port with nothing connected.Expected behavior is that when the websocket connection is closed by the client, the websocat server should close the other side and become ready to serve again.
The text was updated successfully, but these errors were encountered: