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

HaProxy and Websockets

Scheduled Pinned Locked Moved Cache/Proxy
2 Posts 2 Posters 971 Views
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 Nov 28, 2021, 9:38 PM

    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.

    M 1 Reply Last reply Dec 14, 2021, 10:19 PM Reply Quote 0
    • M
      MrPete @jimfreeze
      last edited by Dec 14, 2021, 10:19 PM

      @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.
        [[user:consent.lead]]
        [[user:consent.not_received]]