HTTP reverse proxy · Go 1.27

One request in.
Every feature out.

An nginx-style reverse proxy, written by hand in Go.

The request

Every request is a beam of light.

Prism takes it apart, then rebuilds it for the backend.

Dispersion

One beam in. Six rays out.

  1. Core proxy
  2. Routing & security
  3. Traffic
  4. Resilience
  5. Caching
  6. Operations

01 · Core proxy

Routes by host. Streams both ways.

TLS by SNI, longest-prefix routing, one pooled 32 KB buffer per direction.

routingwaiting for a request…
3dependencies: YAML, Prometheus, bcrypt

Routing ↗

02 · Routing & security

Decides who gets in. And where they go.

Allow lists, Basic auth and API keys. Sticky canaries and shadow traffic.

Security ↗

03 · Traffic

Spreads the load. Meters the flood.

Four balancers, a per-IP rate limit and a bounded queue.

b3 is slow on purpose. Try least_conn.

04 · Resilience

Fails over before anyone notices.

Circuit breakers, outlier ejection, and retries on a budget.

12,001requests, zero errors, while make chaos killed a backend

05 · Caching

Fetches once. Answers everyone.

RFC 9111, request coalescing, stale-while-revalidate.

06 · Operations

Reloads live. Shows its work.

A SIGHUP swaps the config without dropping a request.

Against nginx · 2026-10-21

Measured. Weak spots included.

99,234req/s on cache hits. nginx: 98,666.
~4%throughput cost of turning every feature on
2.4×nginx's CPU per proxied request
1.23×backend load in an outage with the retry budget. 2.99× without.

One laptop, four pinned CPUs each, median of three runs. Full results ↗

Built to be broken

More test code than proxy code.

391tests, all -race
9fuzz targets
33benchmarks
2chaos runs

Quickstart · Go 1.27

One binary. One YAML file.

$ make build && ./bin/prism -config prism.yaml
listeners: [{ addr: ":8080" }]

upstreams:
  api:
    balancer: least_conn
    backends: [{ url: "http://10.0.0.1:8080" }]
    health: { path: /healthz, interval: 5s }

routes:
  - match: { path_prefix: "/api/" }
    upstream: api
    rate_limit: { per_ip: "5/s", burst: 5 }
    retry: { attempts: 2, on: [connect_error, timeout] }
    cache: { enabled: true }

admin: { listen: "127.0.0.1:9901" }

Hover a key to light its ray.

All of it, in one binary.

The docs build a reverse proxy up from first principles.