It doesn't have to be REST: Websockets in Go
summary
WebSockets in Go let servers push synchronized state to many clients instead of polling, reducing thousands of HTTP requests and avoiding repeated credentials by authorizing once per connection (less CSRF surface). The standard library exposes low‑level frame reads; Gorilla WebSocket guarantees full messages, offers an Upgrade struct (origin checks, compression, handshake timeout) and passes the Autobahn 500+ tests. For extreme performance the ws zero-copy upgrade reuses I/O buffers; typical servers run connection handlers (e.g. listen :4000) and marshal JSON with per-connection write mutexes.
AI-written summary · about
chapters (12)
- 0:00Start
- 0:58Overview
- 2:13Communication Protocol
- 5:35Two Principles To Approach the Process of Architectural Software Design
- 7:09Uniform Interface Constrain
- 9:08Why Use Websockets
- 14:38Websocket Library in the Go Standard
- 17:17The Guerrilla Websocket Library
- 20:41Websocket Library
- 25:05Zero Copy Upgrade
- 28:52Message Endpoints
- 33:02Recap
related talks
23mDo you really need WebSockets?
24mBuilding web services in Go
29mWebSockets Bring Light at the End of the Tunnel
01h 28mIntroduction to WebSockets
25mTaming Client-Server Communication
41mWebsockets as the glue to interactivity
45mThe Changing Face of Communications: IoT, REST, & Reactive
25mHow I Write HTTP Web Services After 8 Years
