Hello
I am running into an odd issue where long-lived WebSocket connections proxied through HAProxy in TCP mode are getting reset unexpectedly. The disconnections occur after a few minutes of idle time; even though I have disabled / extended all relevant timeout settings like
timeout client
, timeout server
,& timeout tunnel
. What’s strange is that there’s no clear logging from HAProxy indicating why the connection was dropped.
When I connect to the WebSocket backend directly, everything works perfectly even idle connections stay alive indefinitely. But once I put HAProxy in the middle (in TCP mode); the issue arises intermittently.
Switching to HTTP mode avoids the problem; but I need raw TCP for binary messaging in this WebSocket implementation, so I can’t use HTTP mode as a workaround.
What else should I check? Could there be something lower-level like OS-level TCP keepalive settings, NAT timeouts / HAProxy’s own buffer handling in TCP mode causing silent resets? Checked The Four Essential Sections of an HAProxy Configuration guide for reference. While exploring system behavior for projects related to what is Agentic AI; I began noticing frequent WebSocket disconnects when routed through HAProxy in TCP mode.
Has anyone encountered similar behavior? Any ideas or examples would be really helpful.
Thank you !!