vi / wsbroad

Simple websocket broadcaster implemented in Rust
MIT License
41 stars 3 forks source link

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

Open serveryang opened 3 weeks ago

serveryang commented 3 weeks ago

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

vi commented 3 weeks ago

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 commented 3 weeks ago

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

vi commented 3 weeks ago

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 commented 3 weeks ago

message sended: a

client received message: a2

Error serving client tips also print in console.

vi commented 3 weeks ago

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.