wsbroad icon indicating copy to clipboard operation
wsbroad copied to clipboard

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

Open serveryang opened this issue 1 year ago • 5 comments

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

serveryang avatar Jun 14 '24 09:06 serveryang

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.

vi avatar Jun 14 '24 12:06 vi

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

serveryang avatar Jun 15 '24 10:06 serveryang

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).

vi avatar Jun 15 '24 14:06 vi

message sended: a

client received message: a2

Error serving client tips also print in console.

serveryang avatar Jun 17 '24 03:06 serveryang

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.

vi avatar Jun 17 '24 07:06 vi