WebSocket

WebSocket is a protocol that establishes a persistent, bidirectional communication channel between a client and a server. In this course, it allows the Go backend to push live order-tracking updates to an Expo customer app without repeated polling requests.

Minimal example

go
conn, err := websocket.Accept(w, r, nil)
if err != nil {
    return
}
defer conn.CloseNow()

Learn this concept

Lesson 5.2 · Managing WebSocket connections

Used in exercises

Exercise 5.3 · Per-user WebSocket hub