Skip to content
Timi Adewumirev 2026.09
Status
active
Started
Stack
go, net/http, tls, prometheus, opentelemetry
Project sheet

edge

A traffic router in Go: one binary that is a reverse proxy, a router, a load balancer, and a TLS terminator, built on the standard library with Envoy's vocabulary.

Problem#

Most of the routing I run in production sits inside a large proxy with a configuration language of its own. When a rule misbehaves, the answer is in that proxy's internals, not in code I can read and test. I wanted a router small enough to understand end to end, written in the language I use for infrastructure tools, with the parts that matter in production built in from the start: timeouts, retries with a budget, health checks, and metrics.

Approach#

edge follows Envoy's words so that reading edge teaches Envoy: listener, route, cluster (here "pool"), retry condition, outlier detection, circuit breaker. The request path has nine steps, and one package owns each step.

  • A design contract first. DESIGN.md fixes the packages, their imports, and the request path before any code. Each package imports core and nothing else of edge, so no package can reach around another.
  • One YAML file. Listeners, routes, and upstream pools live in one file. The router swaps its table atomically on reload, so no request sees a half-loaded configuration. An admin API on localhost shows the live routes and triggers a reload.
  • Routing on host, path, header, and method. Paths match through a radix tree. The router has fuzz tests and property tests alongside its unit tests.
  • Upstream pools that defend themselves. Round-robin, weighted, ring hash, and Maglev balancing. Active health checks, outlier detection, a circuit breaker, and connection draining.
  • Failure that explains itself. Every upstream failure maps to a status code and a Proxy-Status error type from RFC 9209, so a client can tell a refused connection from a slow one. Retries draw from a per-route budget rather than a fixed count.
  • TLS and observability. Per-host certificates with SNI, reload without restart, ACME, and mutual TLS to upstreams. Prometheus metrics per route and per pool, structured access logs, and trace propagation.

The HTTP server, the reverse proxy, and TLS come from the Go standard library. The only other dependencies are the Prometheus and OpenTelemetry clients, a YAML parser, and golang.org/x.

Outcome#

In progress. Every package has tests and go test ./... passes. The router runs in front of three replicas of a small API in the lab set-up, with TLS on one listener and the admin API on another. Next: the Kubernetes deployment and a load test against Envoy on the same hardware.