title: SignalR through Load Balancer
body: <p>I am having a strange issue with SignalR through different load balancers (I have tried elastic load balancer and HAProxy).</p>
  
  <p>My setup is as follows:</p>
  
  <p>C# client -> HAProxy --> (SignalR Host 1 or SignalR Host 2)</p>
  
  <p>The HAProxy is configured to roundrobin with cookies to ensure session stickiness</p>
  
  <p>balance     roundrobin<br>
  cookie SERVERID insert indirect nocache</p>
  
  <p>When I have a single SignalR host behind the proxy (using Long Polling or Server Send Event) everything works fine. I can connect, invoke methods and handle callbacks.</p>
  
  <p>As soon as I add a 2nd SignalR server things start to go poorly. I can connect fine and the connections properly load balance. I can send messages and they properly stick to the server. The problem is that callbacks just never make it back to my client through the proxy.</p>
  
  <p>What is perplexing is this works fine with a single host configured on the load balancer.</p>
  
  <p>Another note: I am not looking to scale out SignalR with a backplane. My signalr hosts don't need to know about each other or care about clients connected. In my architecture SignalR is the frontend to an application layer tier that handles communication service wide.  I am essentially using Signlar to support push notifications from the application.</p>
  
  <p>Thoughts?</p>