WebSockets & Server-Sent Events
Learn real-time web communication: polling, Server-Sent Events, the WebSocket protocol, scaling with pub/sub, security and testing.
Learn WebSockets & Server-Sent Events free, in English or Hindi, with lessons, shorts and interview questions.
Start course → · Interview questions
32 lessons · 10 modules · Free
What you'll learn
- Choose between polling, Server-Sent Events and WebSockets for a feature and justify the trade-offs.
- Write and parse the text/event-stream format, and build resumable SSE endpoints with Last-Event-ID.
- Explain the WebSocket handshake, frame format, masking, ping/pong and close codes.
- Build WebSocket servers and clients in Node.js and Python with message envelopes, rooms, heartbeats and reconnection.
- Scale real-time systems across servers with pub/sub, handle backpressure and deploy without reconnect storms.
- Secure real-time endpoints with authentication at upgrade, Origin checks, validation and rate limits, and debug and test them.