Repository navigation
dsh web: keepAliveTimeout (5 s default) still unfixed in 0.2.1-rc.2 — independent reproduction and verified fix #10533
Replies: 1 comment
|
Still unfixed on master as of 22ddee3. One placement detail worth adding: set both fields once after the if/else (:566-:583) and before On the values, 65 s / 66 s is right — Node documents that Your "nothing in the log" observation also follows from the code: upgrades are served by the |
Uh oh!
There was an error while loading. Please reload this page.
Continues #2270, which was closed as Q&A on 2026-08-16 with no answer and no code change. The bug is still
present in the newest published package:
@deepseek-ai/dsh-host-webserver@0.2.1-rc.2(npm tagnext)contains zero occurrences of
keepAliveTimeout, andcreateServeris still called without any timeoutconfiguration.
Summary
On a high-latency link (~300 ms RTT) the browser cannot complete the WebSocket upgrade to
/api/remote.mux.The UI stays on "reconnecting" and chats never load. On the server side nothing is visible: no request
line, no status code, no log entry, because the handshake dies before the request is read. This makes the
failure expensive to diagnose — the browser-trust fence, cookies, TLS, the reverse-proxy shape and
Tailscale/DERP were all verified innocent first.
Reproduction
dsh --profile web --port 3080 --tls-cert … --tls-key …on a host reachable over a high-latency path.tailscale serve --bg --tcp 3080 tcp://127.0.0.1:3080.WebSocket connection to 'wss://…/api/remote.mux' failed: The network connection was lost.Server-side proof:
strace -f -p <pid> -e trace=readshows zeroGET /api/remote.muxreads over 90 swhile ordinary HTTP traffic keeps flowing. Probes that always open a fresh connection (
curl,http.request) upgrade fine — the failure only occurs on connection reuse.Current behavior
Connection: keep-alive,Keep-Alive: timeout=5.Expected behavior
The upgrade succeeds when the browser reuses a connection it had kept idle, and the session stays stable.
Analysis
Matches #2270:
createServer()/createServer$1()in@deepseek-ai/dsh-host-webserverset neitherkeepAliveTimeoutnorheadersTimeout, so Node's 5 000 ms default applies. Browsers keep idle keep-aliveconnections and reuse them for the upgrade; at ~300 ms RTT the server's FIN has not arrived yet.
Fix verified locally (immediately before
this.server.listen(...)):Result:
Keep-Alive: timeout=65, three live mux sessions exchanging ping traffic (~120 bytes per 8 s), andno reconnects across 90-second windows and a 120-second single-connection hold — with two different
browsers (Safari and Firefox).
Additionally useful for a fix: making both values configurable on the
webserverentry, and defaultingkeepAliveTimeoutwell above 5 000 ms, since deployments behind a proxy/NAT are exactly the ones that hit it.Environment
dsh --profile web --port 3080 --no-open --trusted-host <tailnet-name> --tls-cert … --tls-key …tailscale serve --bg --tcp 3080 tcp://127.0.0.1:3080(L4, no L7 proxy)All reactions