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

Error serving client: WebSocket protocol error: Sending after closing is not allowed #3

Closed
serveryang opened this issue Jun 14, 2024 · 5 comments

Comments

@serveryang
Copy link

command echo "from backend: send data to /abc" | websocat -1 --exit-on-eof ws://127.0.0.1:9002/abc

and wsbroad got error info:
Error serving client: WebSocket protocol error: Sending after closing is not allowed

  • 127.0.0.1:39294 -> /abc
@vi
Copy link
Owner

vi commented Jun 14, 2024

I expect the error to be non-fatal. --exit-no-eof may abandon a connection without proper WebSocket close and I expect wsbroad to just continue handling other connected clients.

@serveryang
Copy link
Author

can websocat send message finished, and send close WebSocket to wsbroad as normal usage?

@vi
Copy link
Owner

vi commented Jun 15, 2024

Just remove --exit-on-eof? It will send one message, receive one reply message and exit.

If you don't want to receive a reply, use -u (--unidirectional).

@serveryang
Copy link
Author

serveryang commented Jun 17, 2024

message sended:
a

client received message:
a2

Error serving client tips also print in console.

@vi
Copy link
Owner

vi commented Jun 17, 2024

Do you need to just inhibit those messages from wsbroad?

I see everything works more or less properly, aside from the annoying console messages.

I tried locally and do not see those unclean disconnection messages. Is there anything special between wsbroad and websocat instances? Is it on Linux?

To aid debugging, you can attach a traffic dump (pcap) of the experiments.

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