Server-Sent Events
Also called SSE, EventSource
A web standard that lets a server push a continuous stream of updates to a browser over one long-lived HTTP connection. It is how many AI chat apps stream answers word by word.
What are server-sent events?
Server-sent events (SSE) are a way for a server to send a stream of updates to a browser over a single HTTP connection that stays open. The communication is one-way: the server pushes events to the client, and the client cannot send events back over the same connection.
How does it work?
The browser makes an ordinary HTTP request, and the server answers with the content type text/event-stream and keeps the response open. It then writes events as plain text, each a few field: value lines ended by a blank line. In the browser, the EventSource interface receives them, and if the connection drops it reconnects automatically.
What is a simple example?
When you ask an AI chatbot a question and the answer appears word by word, the app is often receiving the tokens as server-sent events. Each piece of text arrives as it is generated instead of after the whole answer is finished.
Why does it matter?
SSE is simple, works over normal HTTP and is a natural fit for streaming model output. For two-way, interactive connections, see WebSocket. Protocols such as the AG-UI protocol stream agent events to apps in a similar way.