HaProxy and Websockets
-
Hello.
I'm trying to configure HaProxy to upgrade a connection for websockets.
Before haproxy, I used nginx and had the following in my
nginx.conf
fileproxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host;
My web system uses Phoenix sockets, and the websockets are sent over the same port but with the path
/live
.My best guess at translating from other examples is:
This doesn't appear to upgrade the socket, and I don't have any real way of testing it other than watching for certain failures on mobile.
Any help would be appreciated.
-
@jimfreeze Unfortunately, a bug in HAproxy 2.2 breaks websockets.
Hopefully we can get 2.3 or future soon... or the patch integrated!
(https://github.com/haproxy/haproxy/issues/737)
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.