This is a basic load balancer implemented in Go that distributes incoming requests to a list of servers using the round-robin algorithm.
The load balancer listens for incoming requests and routes them to different backend servers. Here's how it functions:
-
Requests are distributed in a round-robin fashion, ensuring each server gets an equal share of the load.
-
Health checks can be implemented for each server, but in this code, all servers are considered healthy.
-
Clone the repository to your local machine.
-
Install Golang if not already installed.
-
Run the load balancer:
go run main.go