Server-Sent Events use an HTTP response kept open by EventSource to deliver a sequence of text events. The browser can reconnect and resume from a last event ID.
The demo grows a one-way event log, disconnects, and resumes. Frequent client-to-server messages call for a bidirectional transport instead.
When to use
Use it for server-to-browser updates such as notifications, progress, or feeds.