▶ Interactive Lab

Server-Sent Events (SSE)

Server-push one-way stream over HTTP.

Advertisement
SSE is one-way (server → client). HTTP-based, auto-reconnect. Simpler than WebSocket.

What you're seeing

SSE: long-lived HTTP response. Server writes data: \n\n events. Browser EventSource API receives them. Auto-reconnect with Last-Event-ID for resumption.

Right for: notifications, server-push updates. Not for bidi (use WebSocket). Plays nice with HTTP/2.

★ KEY TAKEAWAY
SSE = server pushes events to client over a long-lived HTTP response. One-way only. Auto-reconnects with Last-Event-ID.
▶ WHAT TO TRY
  • Click Open SSE, then Server emits event several times.
  • Events flow right-to-left, only when the connection is open.