Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    HaProxy and Websockets

    Cache/Proxy
    2
    2
    945
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jimfreeze
      last edited by

      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 file

            proxy_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:

      Screen Shot 2021-11-28 at 3.35.13 PM.png

      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.

      MrPeteM 1 Reply Last reply Reply Quote 0
      • MrPeteM
        MrPete @jimfreeze
        last edited by

        @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)

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.