打开cygwin终端

下载程序
haproxy程序
输入下面命令下载程序
wget http://download.openpkg.org/components/cache/haproxy/haproxy-2.8.3.tar.gz

解压
tar -zxvf haproxy-2.8.3.tar.gz

进入到程序路径
cd haproxy-2.8.3

编译安装
make TARGET=cygwin&&make install

编译成功

创建 haproxy.cfg 文件
- # 进程级别的参数
- global
- ulimit-n 3200
-
- defaults
- log global
- mode tcp
- option dontlognull
- timeout connect 5000
- timeout client 50000
- timeout server 50000
-
- listen admin_status
- bind *:1188
- mode http
- stats refresh 30s
- stats uri /
- stats auth haproxy:haproxy
- stats admin if TRUE
-
- frontend ss-in
- bind *:2000
- default_backend ss-out
- backend ss-out
- server sserver_name 10.0.0.0:443 maxconn 20480
开始脚本 run.bat
- haproxy.exe -f haproxy.cfg -d
- pause
停止脚本 stop.bat
taskkill /IM haproxy.exe /F
