Web APIsLesson 60Free preview
Server-Sent Events API
This lesson is part of HTML · All levels
Summary
Server-Sent Events (SSE) allows servers to send data continuously to web pages via a single HTTP connection path. On the client side, the EventSource object is used to open the connection and handle incoming messages. This feature is suitable for live updates such as notifications, stock prices, or match scores.
Key points
- SSE sends updates from the server to the browser in one direction
- The client uses new EventSource("url") to listen to messages
- Event onmessage captures the data sent by the server
- Suitable for live updates such as notifications and live scores
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.