SSE Dead Client Detection Issue Behind Apify Standby Proxy
The core issue appears to be that Apify’s proxy does not propagate the actual client disconnect to the Actor. Therefore:
-
close, error, and timeout events are never triggered on the server side,- the server continues writing data with no feedback that the real client is gone,
- stale SSE connections remain in memory and cannot be cleaned up correctly.
I currently rely on several heuristic workarounds, such as:
- marking a connection as dead if no successful write occurs within a certain time window,
- monitoring pending writes to detect possible dead streams,
- running periodic checks to validate connection state.
These strategies help mitigate the issue but are not fully reliable, since they rely on indirect signals rather than a definitive disconnect notification from the network layer.
For this reason, I need clarification on the following points:
1. Does Apify Standby mode enforce any specific timeout, keep-alive, or proxy behavior for SSE connections?
2. Is there any officially recommended method to detect dead SSE clients when running behind the Apify proxy?
3. Can additional HTTP headers influence how the proxy handles disconnects or keep-alives?
