feat(web): add WebSocket heartbeat to prevent false disconnections (#4633)

* feat(web): add WebSocket heartbeat to prevent false disconnections

Idle WebSocket connections are often silently closed by network
intermediaries (e.g. Cloudflare's 100s idle timeout), causing false
"connection lost" messages even though the session is still alive.

Keep the control WebSocket alive by sending a protocol-level Ping
every 30s and closing the connection if no Pong is received within
45s. Browsers reply to Pings automatically below the JS layer, so
this keep-alive survives JS event-loop blocks and tab throttling.

* add some cleanups

* rustfmt

* add pr

---------

Co-authored-by: Aram Drevekenin <[email protected]>
This commit is contained in:
Thibault Saunier
2026-09-25 13:45:16 +02:00
committed by GitHub
co-authored by Aram Drevekenin
parent 53051a1a32
commit fc400dfef9
3 changed files with 162 additions and 13 deletions
+1
View File
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* fix: group bar-plugins on viewport edge for layout purposes (https://github.com/zellij-org/zellij/pull/5653)
* fix: resize state and correctness (https://github.com/zellij-org/zellij/pull/5656)
* fix: compress kitty images if the host terminal supports it (https://github.com/zellij-org/zellij/pull/5608)
* fix: add websocket heartbeat to webserver to prevernt idle disconnect through proxies (https://github.com/zellij-org/zellij/pull/4633)
## [0.45.1] - 2026-08-28
* fix: nested-session detection over SSH (https://github.com/zellij-org/zellij/pull/5522)