Reference
Design-review prompts for “SSE is three lines on the client” reality.
EventSource: GET only; no custom headers API
(WHATWG #2177).
withCredentials: true + CORS credentials.
fetch + stream parse (or a
library), cookie session for the stream, or short-lived token in URL
(prefer not to log tokens).
Access-Control-Allow-Credentials and a specific origin
(not *).
Content-Type: text/event-stream,
Cache-Control: no-cache.
proxy_buffering off and/or
X-Accel-Buffering: no); raise read timeouts.
| Constraint | Often better |
|---|---|
| Custom headers / POST body | fetch + ReadableStream parse |
| True duplex messaging | WebSocket |
| Binary media | WebSocket / WebRTC / plain download |
| Many tabs, stuck on h1 | HTTP/2, shared stream, or WebSocket |