Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swarajkumarsingh/load-balancer
Simple Load Balancer using Golang, which uses Round Robin Algorithm, and distributes connection to mutiple servers
https://github.com/swarajkumarsingh/load-balancer
algorithm backend go golang load-balancer loadbalancer loadbalancing round-robin
Last synced: 10 days ago
JSON representation
Simple Load Balancer using Golang, which uses Round Robin Algorithm, and distributes connection to mutiple servers
- Host: GitHub
- URL: https://github.com/swarajkumarsingh/load-balancer
- Owner: swarajkumarsingh
- Created: 2023-10-07T10:37:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-07T10:38:22.000Z (about 1 year ago)
- Last Synced: 2024-06-19T21:53:32.063Z (5 months ago)
- Topics: algorithm, backend, go, golang, load-balancer, loadbalancer, loadbalancing, round-robin
- Language: Go
- Homepage: https://github.com/swarajkumarsingh/load-balancer
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Golang Round-Robin Load Balancer
This is a simple round-robin load balancer implemented in Golang. It distributes incoming HTTP requests evenly among a list of backend servers.
## Usage
1. Clone the repository:
```bash
git clone https://github.com/swarajkumarsingh/load-balancer.git
```2. Build and run the load balancer:
```bash
go build main.go
./main
```3. Send HTTP requests to the load balancer's endpoint (e.g., http://localhost:8080) to distribute them among your backend servers.
## Configuration
### You can configure the load balancer by modifying the main.go file. Here are the key points for configuration:
- Add or remove backend server URLs in the backendServers slice in the main function.
- You can change the port on which the load balancer listens by modifying the port variable in the main function.## Dependencies
The load balancer uses the following Go standard library packages:
- net/http: For creating the HTTP server.
- net/http/httputil: For creating reverse proxies.
- net/url: For parsing and handling URLs.## License
This project is licensed under the MIT License - see the LICENSE file for details.## Contributing
Feel free to contribute to this project by opening issues or pull requests. Your contributions are welcome!## Author
Swaraj kumar singh