Skip to content
Commitwise
Menu

Server-sent events (SSE)

Also called: SSE, EventSource

A long-lived HTTP response in which the server keeps sending events to the client, in one direction.

Definition

The client opens a normal HTTP request and the server writes events into the response as they happen. Because it is plain HTTP, it works through proxies and load balancers, and browsers reconnect automatically, sending the id of the last event received in a Last-Event-ID header so the server can send what was missed. It suits live feeds where only the server sends data; WebSockets suit two-way traffic.

In practice

A restaurant's order board receives each new order as an event within a second, and catches up after a reconnect.

Related terms

Esc

Type to search the whole site.