This repo contains two QUIC-focused demos:
simplecdn/: a small CDN and origin pair that serve a static website and a real sample HLS stream over HTTP/3.test-conMigration/: a standalone QUIC connection-migration demo.
- HTTP/3 origin server using
quic-go/http3 - HTTP/3 CDN that fetches from the origin over QUIC
- In-memory LRU caching for normal
GET/HEADresponses - Range request bypass, so partial content stays origin-backed
- Sample HLS playlist and MPEG-TS segments in
simplecdn/static/hls/ - Separate QUIC connection-migration client/server example
Build the binaries:
cd simplecdn
make buildRun the origin server from the static asset directory:
cd simplecdn/static
../bin/serverRun the CDN in another terminal:
cd simplecdn
./bin/cdn -origin https://localhost:443 -addr :8443Then open:
- Origin:
https://localhost/ - CDN:
https://localhost:8443/ - HLS playlist through the CDN:
https://localhost:8443/hls/stream.m3u8
Expected behavior:
- The first CDN request for a normal asset returns
X-Cache: MISS - Repeating the same request returns
X-Cache: HIT - Requests with a
Rangeheader are forwarded and remainX-Cache: MISS
Build:
cd test-conMigration
make buildRun the server:
cd test-conMigration
./bin/serverRun the client:
cd test-conMigration
QUIC_HOST=::1 QUIC_PORT=4242 ./bin/clientTo demonstrate migration, keep the client running and change the client's network path or IP while the QUIC session is still open. The server logs address changes without tearing down the connection.
The automated tests cover:
- CDN cache miss-to-hit behavior
- Range request cache bypass
- HLS playlist handling
- Blocking access to origin key material
Run them with:
GOCACHE=/tmp/go-cache go test ./...
cd simplecdn && GOCACHE=/tmp/go-cache go test ./...