百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

gobetween

> 后端框架
开源

:cloud: 适用于云时代的现代化、简洁的负载均衡器

2.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

:cloud: 适用于云时代的现代化、简洁的负载均衡器

gobetween - modern & minimalistic load balancer and reverse-proxy for the :cloud: Cloud era.

Current status: Maintenance mode, accepting PRs. Currently in use in several highly loaded production environments.

Features

  • Fast L4 Load Balancing

    • TCP - with optional The PROXY Protocol support
    • TLS - TLS Termination + ACME & TLS Proxy
    • UDP - with optional virtual sessions and transparent mode
  • Clear & Flexible Configuration with TOML or JSON

    • File - read configuration from the file
    • URL - query URL by HTTP and get configuration from the response body
    • Consul - query Consul key-value storage API for configuration
  • Management REST API

    • System Information - general server info
    • Configuration - dump current config
    • Servers - list, create & delete
    • Stats & Metrics - for servers and backends including rx/tx, status, active connections & etc.
  • Discovery

    • Static - hardcode backends list in the config file
    • Docker - query backends from Docker / Swarm API filtered by label
    • Exec - execute an arbitrary program and get backends from its stdout
    • JSON - query arbitrary http url and pick backends from response json (of any structure)
    • Plaintext - query arbitrary http and parse backends from response text with customized regexp
    • SRV - query DNS server and get backends from SRV records
    • Consul - query Consul Services API for backends
    • LXD - query backends from LXD
  • Healthchecks

    • Ping - simple TCP ping healthcheck
    • Exec - execute arbitrary program passing host & port as options, and read healthcheck status from the stdout
    • Probe - send specific bytes to backend (udp, tcp or tls) and expect a correct answer (bytes or regexp)
  • Balancing Strategies (with SNI and MaxConnections support)

    • Weight - select backend from pool based relative weights of backends
    • Roundrobin - simple elect backend from pool in circular order
    • Iphash - route client to the same backend based on client ip hash
    • Iphash1 - same as iphash but backend removal consistent (clients remain connecting to the same backend, even if some other backends down)
    • Leastconn - select backend with least active connections
    • Leastbandwidth - backends with least bandwidth
  • Integrates seamlessly with Docker and with any custom system (thanks to Exec discovery and healthchecks)

  • Single binary distribution

Architecture

Usage

  • Install with snap: https://snapcraft.io/gobetween
  • Other Installation Options
  • Read Configuration Reference
  • Execute gobetween --help for full help on all available commands and options.

Hacking

  • Install Go 1.24+ https://golang.org/
  • $ git clone [email protected]:yyyar/gobetween.git
  • $ make
  • $ make run

Debug and Test

Run several web servers for tests in different terminals:

  • $ python -m SimpleHTTPServer 8000
  • $ python -m SimpleHTTPServer 8001

Instead of Python's internal HTTP module, you can also use a single binary (Go based) webserver like: https://github.com/udhos/gowebhello

gowebhello has support for SSL sertificates as well (HTTPS mode), in case you want to do quick demos of the TLS+SNI capabilities of gobetween.

Put localhost:8000 and localhost:8001 to static_list of static discovery in config file, then try it:

  • $ gobetween -c gobetween.toml

  • $ curl http://localhost:3000

Enable profiler and debug issues you encounter

[profiler]
enabled = true     # false | true
bind    = ":6060"  # "host:port"

Performance

It's Fast! See Performance Testing

The Name

It's a play on words: gobetween ("go between").

Also, it's written in Go, and it's a proxy so it's something that stays between 2 parties :smile:

License

MIT. See LICENSE file for more details.

Authors & Maintainers

  • Yaroslav Pogrebnyak
  • Nick Doikov
  • Ievgen Ponomarenko
  • Illarion Kovalchuk

All Contributors

  • See AUTHORS

Community

  • Join gobetween Telegram group here.

Logo

Logo by Max Demchenko

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Fast L4 Load Balancing
  • •TCP - with optional The PROXY Protocol support
  • •TLS - TLS Termination + ACME & TLS Proxy
  • •UDP - with optional virtual sessions and transparent mode
  • •Clear & Flexible Configuration with TOML or JSON
  • •File - read configuration from the file
  • •URL - query URL by HTTP and get configuration from the response body
  • •Consul - query Consul key-value storage API for configuration
  • •Management REST API
  • •System Information - general server info

> 标签

Gobackendcloudconsuldiscovery

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架