JavaScript

Explain Server-Sent Events (SSE)

Hard
5
Added
HTTP-based protocol for server-to-client streaming using EventSource API.

Solution Code

JavaScript
const es = new EventSource('/stream');
es.onmessage = e => console.log(e.data);
Explanation
Simple unidirectional communication. Auto-reconnects. Text-only data.

Guided Hints

Compare with WebSockets
Error handling