Nuts and Bolts of WebSocket
summary
Shows how WebSocket cuts header overhead (an 11‑byte payload cost 663 bytes over HTTP), uses a 2‑byte framing over a single upgraded TCP connection, and implements Java endpoints with JSR 356 and WildFly/Undertow examples. Live demos: a chat and a collaborative whiteboard using encoders/decoders and JSON/binary snapshots that work end‑to‑end. Benchmarks report ~10x faster than REST for many small messages (10,000 messages test) and vertical scaling to 80,000 concurrent connections. Covers proxies, TLS (WSS), Atmosphere fallbacks, Chrome DevTools and Wireshark debugging.
AI-written summary · about
chapters (20)
- 0:00Intro
- 0:47How WebSocket solves it?
- 2:11What is WebSocket?
- 3:47Handshake Request
- 4:25Handshake Response
- 4:46How does it work?
- 7:21WebSocket JavaScript API
- 8:18Support in Browsers
- 9:55Java API for WebSocket
- 12:13Annotated Endpoint
- 12:52WebSocket Annotations
- 13:46@ServerEndpoint attributes
- 17:09Chat Server Simplified
- 21:14Custom Payloads: Text encoder
- 21:31Custom Payloads: Binary decoder
- 27:05Client Endpoint
- 29:22Securing WebSockets
- 32:53Load Balance WebSocket
- 36:53Server-Sent Events
- 37:53WebSockets and SSE?
