https://github.com/pariola/lb
Simple Reverse Proxy Load Balancer
https://github.com/pariola/lb
load-balancer reverse-proxy simple
Last synced: 10 days ago
JSON representation
Simple Reverse Proxy Load Balancer
- Host: GitHub
- URL: https://github.com/pariola/lb
- Owner: pariola
- Created: 2021-09-16T13:31:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-10T00:28:39.000Z (over 4 years ago)
- Last Synced: 2024-06-20T03:34:31.581Z (over 1 year ago)
- Topics: load-balancer, reverse-proxy, simple
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lb
a reverse proxy load-balancing server, It implements the Weighted Round Robin Balancing algorithm referenced [here](https://github.com/phusion/nginx/commit/27e94984486058d73157038f7950a0a36ecc6e35).
[Installing](#installing) | [How to Use](#how-to-use) | [Configuration](#configuration)
## Installing
### Using `go install`
You can use the command below to compile and install directly to your $GOPATH/bin
```sh
go install github.com/pariola/lb@latest
```
## How to Use
After installing, run the command below to start the server:
```sh
lb
```
Now the server proxies every request to downstream backends.
## Configuration
Configuration format is `YAML` and path defaults to `lb.yml`.
### Available Values
| **Name** | **Description** | **Default** |
|----------------------|-------------------------------------------------------------------------------|:-----------:|
| `port` | Port the server will listen on | `3000` |
| `retries` | Amount retries per request | `1` |
| `health.path` | URL path to listen to for liveness checks | `/` |
| `health.interval` | Interval to perform the liveness checks | `30s` |
| `backends.[].host` | Downstream Server URL to proxy requests to (ex. `localhost:4023`) | `-` |
| `backends.[].weight` | Weight to influence the amount of requests received by the downstream backend | `1` |
Example Configuration:
```yaml
port: 5000
retires: 5
health:
path: /health
interval: 30s
backends:
- host: "localhost:5000"
weight: 2
- host: "localhost:5001"
weight: 1
```