PHP
1
Вклад в тег
wget http://www.haproxy.org/download/1.5/src/haproxy-1.5.3.tar.gz
tar -zxvf haproxy-1.5.3.tar.gz
cd haproxy-1.5.3
make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_CRYPT_H=1 USE_LIBCRYPT=1
make install
fatal error: pcre.h: No such file or directory
sudo apt-get install libpcre3-dev
cat /etc/path/to/crt.pem /etc/path/to/key.pem > /etc/path/to/full.pem
global
log 127.0.0.1 local0
maxconn 10000
daemon
defaults
mode http
log global
option httplog
retries 3
backlog 10000
timeout client 30s
timeout connect 30s
timeout server 30s
timeout tunnel 3600s
timeout http-keep-alive 1s
timeout http-request 15s
frontend public
bind *:WSS_SOCKET_PORT ssl crt /etc/path/to/full.pem
acl is_websocket hdr(Upgrade) -i WebSocket
use_backend ws if is_websocket
default_backend www
backend ws
server ws1 127.0.0.1:SOCKET_SERVER_PORT
backend www
timeout server 30s
server www1 127.0.0.1:8080
window.phpSocket = new ab.Session('wss://sitename.com:3033',
haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -D