Node.js
/Intermediate
Server Sent Events (SSE)
Definition
A standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. It is built on top of standard HTTP.
Explain Like I'm New
WebSockets are a two-way phone call. Server Sent Events (SSE) is a radio broadcast. The client tunes in (connects via HTTP), and then strictly LISTENS. The server continuously pushes updates down the line, but the client cannot talk back over that same line.
Real World Example
A Live Sports Scoreboard or a Twitter Feed. The user doesn't need to send data to the server at 60 frames per second; they just need to watch the score update live. SSE is perfect for this, and much easier to setup than full WebSockets.
Common Use Cases
- •Live feeds/timelines
- •Push notifications
- •Real-time dashboards
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- Are Server Sent Events bidirectional (two-way)?
intermediate
- What protocol does SSE use?