This guide should help you to setup haproxy as a load balancer for multiple proxy endpoints to use with Xilriws.
HAProxy SHOULD be installed on the same machine as Xilriws.
HAProxy Docker stack setup
git clone https://github.com/andi2022/HAProxy-Xilriws.git
cd HAProxy-Xilriws
cp docker-compose.yml.example docker-compose.yml
cp haproxy.cfg.example haproxy.cfg
cp squid.conf.example squid.conf
Add your porxies to the haproxy.cfg in the backend_ptc section. See the haproxy.cfg if your proxies use authentication.
server proxy1 1.2.3.4:3128 check inter 20s fall 3 rise 2
server proxy2 5.6.7.8:3128 check inter 20s fall 3 rise 2
If you install your haproxy on a dedicated server or vps you should secure the stats site.
default username is stats
and the password is haproxy
.
In the following section in the haproxy.cfg you can change the username and password. Use this documentaion.
userlist mycredentials
user stats password $5$eD.zS8VZq0MaisXv$MAnVQCdWObOxpPEX2Jozyq5Fzc.3nOE/Tzm0SSmLgH/
Now you can start the docker stack.
docker compose up -d
You can check now your Haproxy Stats site in your browser. http://serverip:9101/stats For better security you should expose this with a reverse proxy like nginx and make it available over https. (Don't forget to delete the port forwarding to the docker container if you do this!)
Configure HAProxy as proxy in the Xilriws docker compose Add haproxy in the proxies.txt
haproxy:9100
It's important that Xilriws an the HAProxy run in the same docker network. You can put Xilriws and the HAProxy stack in the same docker-compose.yaml or add the network to the HAProxy stack.
Add this at the end of the HAProxy docker-compose.yml to add it to the scanner network from the UnownStack. If Xilriws is also on the scanner network.
networks:
default:
name: scanner
external: true #needs to be created by other file
Final notes Xilriws is a tool developed by the UnownHash team. Github repository