Module 4 · Exercise · ~30 min · Real Go code

Streaming Proxy Server

Build a minimal HTTP streaming proxy. The shape: forward an inbound request to an upstream, stream the response body back without buffering, count bytes, respect context cancellation. Same architecture as a real Canton transaction-stream proxy.

Where
cd module-04-systems-go/exercises/exercise-01-streaming-proxy
go test -v -race ./...

What you're building

client ─[GET /x]─▶  Proxy.ServeHTTP  ─[GET upstream/x]─▶  upstream
                          │                                  │
client ◀─[stream]── ServeHTTP ◀─[chunked stream]───────────┘
                          ▲
                  BytesIn / BytesOut counters
                  context cancellation propagates

Tests check

Shapes you'll use