# Reference: http://blog.haproxy.com/2012/11/07/websockets-load-balancing-with-haproxy/

global
  daemon
  maxconn 4096
  nbproc 2

defaults
  mode http
  balance roundrobin
  option http-server-close
  timeout connect     5s
  timeout client      30s
  timeout client-fin  30s
  timeout server      30s
  timeout tunnel      1h
  default-server inter 1s rise 2 fall 1 on-marked-down shutdown-sessions
  option forwardfor

listen chat
  bind *:80
  default_backend nodes

backend nodes
  option httpchk HEAD /health
  http-check expect status 200
  cookie serverid insert
  server john    server-john:3000    cookie john   check
  server paul    server-paul:3000    cookie paul   check
  server george  server-george:3000  cookie george check
  server ringo   server-ringo:3000   cookie ringo  check
