Created
February 2, 2016 11:34
-
-
Save BartKrol/bdf344ac26c25b0234bc to your computer and use it in GitHub Desktop.
HAProxy Websockets config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
maxconn 4096 | |
defaults | |
mode http | |
balance roundrobin | |
option redispatch | |
option forwardfor | |
timeout connect 5s | |
timeout queue 5s | |
timeout client 50s | |
timeout server 50s | |
frontend http-in | |
bind *:8000 | |
default_backend servers | |
# Any URL beginning with socket.io will be flagged as 'is_websocket' | |
acl is_websocket path_beg /socket.io | |
acl is_websocket hdr(Upgrade) -i WebSocket | |
acl is_websocket hdr_beg(Host) -i ws | |
# The connection to use if 'is_websocket' is flagged | |
use_backend websockets if is_websocket | |
backend servers | |
server server1 [Address]:[Port] | |
server server2 [Address]:[Port] | |
backend websockets | |
balance source | |
option http-server-close | |
option forceclose | |
server ws-server1 [Address]:[Port] weight 1 maxconn 1024 check | |
server ws-server2 [Address]:[Port] weight 1 maxconn 1024 check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment