WebSockets and SSE
Part of the Web course
Your feature is "show the new message the instant it arrives". Every tool you have learned so far assumes the client asks first and the server answers, which means the server has no way to say anything until it is spoken to. You can fake it by asking over and over, and people do, and it works until the cost or the delay stops being acceptable.
HTTP is a shop counter. You walk up, ask for something, get it, and leave. The shopkeeper cannot call you back, because they do not know where you went. That is fine for loading a page and wrong for a chat message that arrives while you are reading. ...
Want to learn Web WebSockets and SSE in a real environment?
Click below, get a fresh Linux box with Web ready to go, and work through WebSockets and SSE hands-on with an AI tutor that knows your code.
Start this lessonWebSockets and SSEWhat you'll learn
- Long polling
- WebSocket upgrade
- Full-duplex frames
- Server-Sent Events
- When to pick each
Read this lesson in your language
All lessons in this course
14 lessons- 1What Is The Web20 min
- 2HTTP vs HTTPS15 min
- 3Request and Response Anatomy30 min
- 4Cookies, Sessions, and Tokens25 min
- 5DNS Explained25 min
- 6TLS and Certificates30 min
- 7CORS30 min
- 8REST API Basics25 min
- 9WebSockets and SSE25 min
- 10Caching and CDNs25 min
- 11Security Headers25 min
- 12Rate Limiting and Throttling20 min
- 13Monitoring and Logging20 min
- 14Capstone: A Tiny Web Server40 min
