websocat sometimes doesn't flush pending data, hangs
Author: the-sun-will-rise-tomorrowCreated Jul 5, 2024Updated Feb 21, 2026
I'm running:
$ websocat \
--exit-on-eof \
--binary \
tcp-l:127.0.0.1:1234 \
wss://1.2.3.4:1234/urlWhen I send a large packet to 127.0.0.1:1234, sometimes websocat doesn't send it to the destination immediately (and just sits there until something causes it to send the pending data).
If the destination sends a PING, websocat does flush pending data.
If I add --ping-interval to websocat's command line, that also causes websocat to send pending data when it sends PINGs.
I can reproduce it with v1.12.0 and current master (34ddb4d1416887059fb249cc97de1538598fed9c).
I can only reproduce it when the target is a remote host and not localhost (probably because the buffer needs to actually pile up locally for the problem to happen).
Source: vi/websocat