Search code examples
audio-streaminghaproxy

Ha proxy close frontend connection


So we are dealing with serious amount of connections into our audio relay servers and due to this we need to load balance them with sticky sessions, of course I know that haproxy is the answer for this but we have one big problem

can haproxy send to a backend server and then completely forget the connection... leaving the connection only reliant on the media server and NOT the proxy? also this will remove all the bandwidth from the proxy server.

Kind Regards MooseH


Solution

  • When you're proxying a connection, you're in the middle of it. Naturally, there's no way to remove yourself without breaking that connection, as TCP terminates on each side of the proxy.

    What you want to do instead is redirect directly to the target servers, with a 302 or 307 and a Location: header. This allows you to balance the load while having clients connect directly to the servers.