RustadvanceddevopsAI generated

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

  1. 01

    Build a basic proxy forwarding requests

    ~2h

    Use hyper to accept incoming requests and forward them to a single hardcoded backend, returning the response.

  2. 02

    Add a backend pool with round-robin selection

    ~2h

    Maintain a list of backend addresses and cycle through them for each incoming request.

  3. 03

    Implement health checks

    ~2.5h

    Spawn a background task that periodically pings each backend and marks it healthy/unhealthy.

  4. 04

    Skip unhealthy backends during selection

    ~1.5h

    Update the load-balancing logic to skip backends currently marked unhealthy.

  5. 05

    Add basic metrics logging

    ~1.5h

    Log request counts and response times per backend for observability.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~9.5h · 5 steps

Tech stack

Tokiohyper