Skip to content

Conversation

@rynfar
Copy link
Owner

@rynfar rynfar commented Jan 26, 2026

Summary

  • Adds a : ping SSE comment every 15 seconds during streaming responses to keep the connection alive through reverse proxies and network intermediaries
  • Wraps the SDK message loop in try/finally to guarantee heartbeat cleanup

Problem

Users running the proxy behind reverse proxies (nginx, Cloudflare, etc.) or over non-localhost networks experience connection resets during the idle period while Claude processes the request. No data flows between content_block_start and the first content_block_delta, causing intermediaries to kill the connection.

Fix

Standard SSE keepalive — periodic : comment lines that are ignored by all compliant clients but keep the TCP connection active.

Closes #1

Sends a : ping comment every 15s during streaming to keep the
connection alive through reverse proxies and network intermediaries.

Closes #1
@rynfar rynfar merged commit 194fd51 into main Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection reset by server

1 participant