Skip to content

Instantly share code, notes, and snippets.

Last active May 19, 2023 20:45
  • Star 29 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
[Haproxy cfg checking Socks5] Haproxy cfg to check the Socks5 connection #tags: GFW, network, haproxy, config
# Example configuration for a possible web application. See the
# full configuration options online.
log local2
chroot /usr/share/haproxy
pidfile /run/
maxconn 2000
user haproxy
mode tcp
log global
option dontlognull
timeout check 30s
maxconn 2000
# This server group is used for final users.
# Each server should point at one foreign Internet address
# SOCKS5 is accepted
listen shadowsocks_turnup
mode tcp
option tcp-check
tcp-check connect
tcp-check send-binary 050100
tcp-check expect binary 0500 # means local client working okay
tcp-check send-binary 050100030a676f6f676c652e636f6d0050 # try to acess google
tcp-check expect binary 05000001000000000000
tcp-check send GET\ /generate_204\ HTTP/1.0\r\n
tcp-check send Host:\\r\n
tcp-check send User-Agent:\ curl/7.52.1\r\n
tcp-check send Accept:\ */*\r\n
tcp-check send \r\n
tcp-check expect rstring ^HTTP/1.0\ 204
balance leastconn
timeout server 600000
timeout client 600000
timeout connect 500
server vnet-xxxx check inter 15s downinter 1m fall 4 weight 10
listen monitor_mgmt
mode http
stats enable
stats admin if TRUE
stats uri /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment