Users now expect chat messages, order updates and dashboards to appear without refreshing the page. Building that well means choosing the right transport, handling dropped connections and keeping many servers in sync. This course covers WebSockets, Server-Sent Events and the libraries built on them, and takes a real-time feature from a single server to a scaled, secure deployment.
What you'll learn
- How WebSockets work: the HTTP upgrade, frames, ping/pong and connection lifecycle
- Choosing between polling, long polling, Server-Sent Events and WebSockets
- Building a WebSocket server in Node.js with the
wslibrary - Socket.IO: rooms, namespaces, acknowledgements and automatic reconnection
- Streaming updates with Server-Sent Events, including AI response streaming
- Authentication and authorisation for socket connections
- Message design, ordering, delivery guarantees and handling reconnects without losing data
- Scaling across servers with Redis pub/sub and sticky sessions behind load balancers
- Real-time in PHP with Laravel Reverb and broadcasting
- Presence, typing indicators, rate limiting and protecting against abuse
Who it's for
- Full-stack developers adding live features to an existing app
- Backend developers building chat, notification or tracking systems
- Developers who have tried Socket.IO and hit problems once they added a second server
Prerequisites
- JavaScript and Node.js basics (see Node.js and Express: Build REST APIs)
- Basic front-end JavaScript in the browser
- Familiarity with HTTP and APIs
Outcomes
By the end of this course you will be able to:
- Choose the right real-time transport for a feature and explain why.
- Build an authenticated chat and notification system.
- Handle disconnects and reconnects without losing or duplicating messages.
- Run real-time features across multiple servers.
Course outline
| Module | Topic |
|---|---|
| 1 | Real-time options: polling, SSE and WebSockets |
| 2 | The WebSocket protocol |
| 3 | A raw WebSocket server in Node.js |
| 4 | Socket.IO: rooms, namespaces and acknowledgements |
| 5 | Server-Sent Events and streaming responses |
| 6 | Authentication and authorisation |
| 7 | Message design and delivery guarantees |
| 8 | Presence, typing indicators and live dashboards |
| 9 | Scaling with Redis pub/sub and load balancers |
| 10 | Laravel Reverb and broadcasting |
| 11 | Security, rate limiting and monitoring |
| 12 | Project: a real-time chat and notification service |
FAQ
Should I always use WebSockets?
No. For one-way updates like notifications or streamed AI output, Server-Sent Events are often simpler and work well with standard HTTP infrastructure.
Can I use managed services instead?
Yes. We compare hosted options such as Pusher, Ably and Supabase Realtime with running your own servers.
Do I need Redis?
Only when you scale beyond one server. Redis for Caching, Queues and Real-Time Features covers it in more depth.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.