title: SignalR v2 with load balancer
body: <p>I am pretty new to SignalR and have been going through some tutorials as I've been tasked with upgrading our current implementation.</p>
  
  <p>We've got an ASP.NET MVC application which uses SignalR (version 1.x). The application is in our F5 load-balanced cloud environment. So we have multiple sites (for different customers) using the same load balancer. To make the SignalR calls servers-side, we use the <code>HubConnection</code> from the <strong>Microsoft.ASPNET.SignalR.Client</strong> namespace and create a proxy like this (full example <a href="http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-net-client" rel="noreferrer">here</a>):</p>
  
  <pre><code>var hubConnection = new HubConnection("http://www.contoso.com/");
  IHubProxy stockTickerHubProxy = hubConnection.CreateHubProxy("StockTickerHub");
  stockTickerHubProxy.On&lt;Stock&gt;("UpdateStockPrice", stock =&gt; Console.WriteLine("Stock update for {0} new price {1}", stock.Symbol, stock.Price));
  await hubConnection.Start();
  </code></pre>
  
  <p>Where <code>http://contoso.com/</code> is the current customer's site URL.</p>
  
  <p>We are looking to upgrade to the latest SignalR (version 2.x) and I am wondering if it is necessary to even use the <code>HubConnection</code>. Even though the article above specifies version 2, it does mention:</p>
  
  <blockquote>
    <p>This document provides an introduction to using the Hubs API for SignalR version 2 in .NET clients, such as Windows Store (WinRT), WPF, Silverlight, and console applications.</p>
  </blockquote>
  
  <p>This is a web application with a regular class library back-end for data access. Taking a look at this <a href="http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc" rel="noreferrer">tutorial</a>, I don't see anything about <code>HubConnection</code> (it also doesn't mention load balancing). Consider the following, from the Chat tutorial:</p>
  
  <pre><code>public class ChatHub : Hub
  {
      public void Send(string name, string message)
      {
          // Call the addNewMessageToPage method to update clients.
          Clients.All.addNewMessageToPage(name, message);
      }
  }
  </code></pre>
  
  <p>Then, in <strong>Statup.cs</strong>:</p>
  
  <pre><code>public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          // Any connection or hub wire up and configuration should go here
          app.MapSignalR();
      }
  }
  </code></pre>
  
  <p>So my question is, are we using SignalR properly? If not, what considerations/modifications need to be made when running a load-balanced application which uses SignalR (v2.x)? I haven't been able to find much regarding load balancing, etc.</p>
  
  <p>Or is this a job for <a href="http://www.asp.net/signalr/overview/guide-to-the-api/working-with-groups" rel="noreferrer">Groups</a>?</p>