A simple, high-performance load balancer built in Rust using asynchronous networking. It accepts incoming TCP connections and forwards them to healthy backend servers using round-robin logic. Designed to be minimal, educational, and extensible.
Asynchronous TCP networking (based on tokio) Round-robin backend selection Thread-safe shared state via Arc<Mutex<_>>
Starts a TCP listener on a specified frontend port.
Accepts incoming client connections.
Selects a backend server from the pool using round-robin.
Forwards data bidirectionally between client and selected backend.
git clone https://github.com/darrendc26/load-balancer.git
cd load-balancer
cargo runStart a few servers to test
python3 -m http.server 5000
python3 -m http.server 5001
python3 -m http.server 5002Now connect via curl
curl http://127.0.0.1:8080You will recieve a response from one of the servers as it is routed to these servers based on Round Robin Algorithm.