Custom Reverse Proxy and Load Balancer
Build a lightweight reverse proxy in Rust that forwards HTTP requests to a pool of backend servers using round-robin balancing, with health checks that remove unhealthy backends. Learners practice async networking, connection pooling, and implementing a load-balancing algorithm from scratch.
- Estimate
- ~9.5h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
Tokio · hyper
Project roadmap
- 01
Build a basic proxy forwarding requests
~2hUse hyper to accept incoming requests and forward them to a single hardcoded backend, returning the response.
- 02
Add a backend pool with round-robin selection
~2hMaintain a list of backend addresses and cycle through them for each incoming request.
- 03
Implement health checks
~2.5hSpawn a background task that periodically pings each backend and marks it healthy/unhealthy.
- 04
Skip unhealthy backends during selection
~1.5hUpdate the load-balancing logic to skip backends currently marked unhealthy.
- 05
Add basic metrics logging
~1.5hLog request counts and response times per backend for observability.
Resources
- DocsThe Rust Book
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack