proxy: haproxy SOCKS5 proxy balancer

This commit is contained in:
ZhymabekRoman 2024-09-25 14:43:44 +05:00
parent e8e6441c88
commit 229d5f0d90
5 changed files with 41 additions and 4 deletions

View file

@ -33,12 +33,11 @@ services:
context: ../
dockerfile: Dockerfile
environment:
- "PROXY_LIST=socks5://wgcf1:1080,socks5://wgcf2:1080"
- "PROXY_LIST=socks5://haproxy-pb:1080"
depends_on:
- dante_1
- dante_2
- haproxy-proxy-balancer
# volumes:
# - ../web:/app/web
# - ../user_data:/tmp/user_data
# - ./core/medium_parser/:/app/medium_parser
# - ./core/rl_string_helper/:/app/rl_string_helper
ports:

View file

@ -0,0 +1,21 @@
version: '3.7'
services:
haproxy-proxy-balancer:
build:
context: ../proxy-balancer
dockerfile: Dockerfile
container_name: haproxy-proxy-balancer
hostname: haproxy-pb
ports:
- "1080:1080"
volumes:
- ../proxy-balancer/haproxy:/usr/local/etc/haproxy/
restart: always
depends_on:
wgcf1:
condition: service_healthy
wgcf2:
condition: service_healthy
networks:
- freedium_net

View file

@ -5,3 +5,4 @@ include:
- docker-compose.wgcf.yml
- docker-compose.db.yml
- docker-compose.utility.yml
- docker-compose.proxy.yml

View file

@ -0,0 +1,2 @@
FROM haproxy:3.0
COPY haproxy/haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

View file

@ -0,0 +1,14 @@
global
log stdout format raw local0 debug
defaults
timeout connect 5000
timeout client 50000
timeout server 50000
listen socks5
bind *:1080
mode tcp
balance roundrobin
server server0 wgcf1:1080
server server1 wgcf2:1080