title: SignalR message not working when sending from server side to client
body: <p>This is my HTML:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function () {
          // Declare a proxy to reference the hub.
          var chat = $.connection.khaosHub;
  
          // Create a function that the hub can call to broadcast messages.
          chat.client.broadcastMessage = function (message) {
              // Html encode display name and message.
              var encodedMsg = $('&lt;div /&gt;').text(message).html(); 
              // Add the message to the page.
              $('#discussion').append('&lt;li&gt;' + encodedMsg + '&lt;/li&gt;');
          };
  
          // Start the connection.
          $.connection.hub.start().done(function () {
              $('#sendmessage').click(function () {
                  console.log("sending");
                  // Call the Send method on the hub.
                  chat.server.send("something");
                  // Clear text box and reset focus for next comment.
                  $('#message').val('').focus();
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My Hub:</p>
  
  <pre><code>public class KhaosHub : Hub
  {
      public void Send(string message)
      {
          Clients.All.broadcastMessage(message);
      }
  }
  </code></pre>
  
  <p>When I click <code>#sendmessage</code> my <code>Send</code> method in <code>KhaosHub</code> is triggered which I have verified using a breakpoint and my message does get sent to the div via <code>broadcastMessage</code>.</p>
  
  <p>Note: I've not included my call to <code>app.MapSignalR</code> in the example above as I know it's working from the client side.</p>
  
  <p>The issue I have is when I call <code>broadcastMessage</code> from some back end code it doesn't work. I am calling it via:</p>
  
  <pre><code>var context = GlobalHost.ConnectionManager.GetHubContext&lt;KhaosHub&gt;();
  context.Clients.All.broadcastMessage("some message");
  </code></pre>
  
  <p>When I debug the <code>Clients.All</code> property, I can't see any clients (I don't know if I should be able to but thought I'd add that information.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT: This is my startup class for the hub:</p>
  
  <pre><code>[assembly: OwinStartup(typeof (Startup))]
  
  namespace CC.Web
  {
      public partial class Startup
      {
          public void Configuration(IAppBuilder app)
          {
              app.MapSignalR();
          }
      }
  }
  </code></pre>