A round-robin load balancer for HTTP proxies.
Go to file
Cyberes d6c916d019 fix incorrect config key 2024-08-12 20:12:25 -06:00
src fix incorrect increment 2024-08-12 20:08:15 -06:00
.gitignore update documentation 2024-04-12 18:34:47 -06:00
LICENSE Initial commit 2024-01-14 14:17:56 -07:00
README.md add connect retry mechanic, hide third-party test info behind additional flag, various minor other changes 2024-08-12 20:01:39 -06:00
build.sh finish prototype 2024-04-12 18:23:18 -06:00
config.example.yml fix incorrect config key 2024-08-12 20:12:25 -06:00
loadbalancer.service make request logging info level, add request logging to webserver, update service file 2024-04-12 19:31:28 -06:00

README.md

proxy-loadbalancer

A round-robin load balancer for HTTP proxies.

This is a simple proxy load balancer that will route requests to a cluster of proxy backends in a round-robin fashion. This makes it easy to connect your clients to a large number of proxy servers without worrying about implementing anything special client-side.

This proxy server will transparently forward HTTPS requests without terminating them, meaning a self-signed certificate is not required. Downstream HTTPS proxy servers are not supported.

Memory usage sits at around 25M under load.

Install

  1. Download the latest release from /releases or run ./build.sh to build the program locally.
  2. cp config.example.yml config.yml
  3. Edit the config.
  4. Start the loadbalancer with ./proxy-loadbalancer --config [path to your config.yml]

The load balancer has experimental support for using curl-impersonate to masquerade as the Chrome browser when performing proxy checks.

  1. Download *.x86_64-linux-gnu.tar.gz from https://github.com/lwthiker/curl-impersonate/releases
  2. Set proxy_check_impersonate_chrome: true
  3. Enter the path to the curl_chrome116 binary in proxy_check_impersonate_chrome_binary

Use

You can run your own "public IP delivery server" canihazip https://git.evulid.cc/cyberes/canihazip or use the default api.ipify.org

An example systemd service loadbalancer.service is provided.

The server displays health, stats, info at /json.

Use --log-third-party-test-failures along with --debug when you want extra info on the third-party proxy tests. This can get very noisy if you have lots of third-party proxies so it's hidden behind an extra flag.

=== Proxy Load Balancer ===
Usage of /tmp/go-build1714785557/b001/exe/proxy-loadbalancer:
  --config [string]
        Path to the config file
  -d, --debug
        Enable debug mode
  -l, --log-third-party-test-failures
        Log third-party test debug info
  -v    Print version and exit

Special Headers

The load balancer accepts special headers to control its behavior:

  • Thirdparty-Bypass: don't use any third-party endpoints for this request.
  • Thirdparty-Include-Broken: use all online endpoints for this request, including third-party ones that failed the special test.