A simpler alternative to WebSocket for server-to-client streaming over standard HTTP — text-only, server-push only (no client-to-server stream), but works through proxies/firewalls and reconnects automatically.
Server-Sent Events is an HTTP standard where the server keeps the response open and streams events as they happen, formatted as `event: name\ndata: payload\n\n`. The browser's EventSource API handles parsing, reconnection, and last-event-id tracking automatically. SSE is one-way (server → client) and text-only, but it's much simpler than WebSocket when bidirectional or binary aren't needed. LLM streaming responses (ChatGPT-style token-by-token) commonly use SSE.
Streaming LLM completion tokens from a FastAPI endpoint to a React client via SSE — the user sees text appearing in real time without WebSocket complexity.
SSE is the simplest answer when you only need server-push: easier to debug than WebSocket, fewer infrastructure gotchas, identical user experience for the common case.
Need help implementing this in your business?
Get Started