i'm still with dealing with the configuration of HAproxy to make it work with socket.io.
my last question was this: HAProxy is caching the forwarding? and i got it working, but for some reason, after the authentication is made and the some commands are sent, the connection is dropped and a new connection is made as you can see here:
info - handshake authorized 2ZqGgU2L5RNksXQRWuhi
debug - setting request GET /socket.io/1/websocket/2ZqGgU2L5RNksXQRWuhi
debug - set heartbeat interval for client 2ZqGgU2L5RNksXQRWuhi
debug - client authorized for
debug - websocket writing 1::
debug - websocket received data packet 5:3+::{"name":"ferret","args":["tobi"]}
debug - sending data ack packet
debug - websocket writing 6:::3+["woot"]
info - transport end (socket end)
debug - set close timeout for client 2ZqGgU2L5RNksXQRWuhi
debug - cleared close timeout for client 2ZqGgU2L5RNksXQRWuhi
debug - cleared heartbeat interval for client 2ZqGgU2L5RNksXQRWuhi
debug - discarding transport
debug - client authorized
info - handshake authorized WkHV-B80ejP6MHQTWuhj
debug - setting request GET /socket.io/1/websocket/WkHV-B80ejP6MHQTWuhj
debug - set heartbeat interval for client WkHV-B80ejP6MHQTWuhj
debug - client authorized for
debug - websocket writing 1::
debug - websocket received data packet 5:4+::{"name":"ferret","args":["tobi"]}
debug - sending data ack packet
debug - websocket writing 6:::4+["woot"]
info - transport end (socket end)
i tried several configurations, something like this: https://stackoverflow.com/questions/4360221/haproxy-websocket-disconnection/
and also declaring 2 backends, and using ACL to forward to a backend that has the option http-pretend-keepalive when the request is a websocket request and to a backend that has http-server-close when the request is only for socket.io static files or is any other type of request that is not websocket.
i would clarify that http-server-close is only on the nginx backend and in the static files backend, http-pretend-keepalive is on frontend all and in the websocket backend.
anyone could point me to the right direction? i tried several combinations and none worked so far :(