Gobetween
From Leo's Notes
Last edited on 14 June 2020, at 23:35.
Gobetween is a load balancer written in Go.
Quick Usage
To quickly get started using Gobetween, use the docker container image. To proxy HTTP/HTTPS traffic to a local server for instance, we can create a docker container using a custom config file:
version: '3.3'
services:
gobetween:
image: yyyar/gobetween
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- ./config.toml:/etc/gobetween/conf/gobetween.toml
Where the config file looks like:
[servers.https]
bind = ":443"
protocol = "tcp"
balance = "weight"
max_connections = 1000
client_idle_timeout = "10m"
backend_idle_timeout = "10m"
backend_connection_timeout = "2s"
[servers.https.discovery]
kind = "static"
static_list = [
"192.168.248.5:443 weight=1"
]
[servers.http]
bind = ":80"
protocol = "tcp"
balance = "weight"
max_connections = 1000
client_idle_timeout = "10m"
backend_idle_timeout = "10m"
backend_connection_timeout = "2s"
[servers.http.discovery]
kind = "static"
static_list = [
"192.168.248.5:80 weight=1"
]
Create the container using docker-compose
. It should proxy traffic destined for this host to the remote 192.168.248.5 host.