This notes and examples are from Hussein Nasser's Websocket course. link: https://www.youtube.com/watch?v=XgFzHXOk8IQ
- bidirectional communication protocol between client and server over the web
- standardized in 2011
- completely compatible with HTTP
- stateful
- built on HTTP 1.1
- it is a stateful
- once the connection is established, either client or server can send data.
- persistent connection
- you can create your own WebSocket or you can use WebSocket library
- full-duplex (no polling)
- HTTP compatible
- firewall friendly (standard)
- proxying is tricky
- level 7 load balancing is challenging (timeouts)
- stateful, difficult to horizontally scale -> solution is to store the state in db and read if server restarts or client disconnects
- server does not know whether client is disconnected or not
Chapters
- What is HTTP?
- What is a Web Server?
- Introduction to WebSockets
- Scaling WebSockets
- Securing WebSockets
- Multi-player Game Design with WebSockets
- Multi-Player Game Building with WebSockets
- Advanced WebSockets