title: Hub handshake failed with error 'WebSocket is not in the OPEN state' during start(). Stopping HubConnection
body: <p>When trying to do a user count I get the error web socket is not in open state, I have Saaskit as well for mutitenancy could that be the cause?  </p>
  
  <p>I have tried specifieng UseWebsockets in the startup.cs with no luck</p>
  
  <pre><code>    {
          private static int UserCount;
          public override Task OnConnectedAsync()
          {
              UserCount++;
              base.OnConnectedAsync();
              this.Clients.All.SendAsync("updateUserCount", UserCount);
              return Task.CompletedTask;
          }
  
          public override Task OnDisconnectedAsync(Exception exception)
          {
              UserCount--;
              base.OnDisconnectedAsync(exception);
              this.Clients.All.SendAsync("updateUserCount", UserCount);
              return Task.CompletedTask;
          }
      }```
  
  ```&lt;script&gt;
      document.addEventListener('DOMContentLoaded', function () {
  
          }
          function onConnectionError(error) {
              if (error &amp;&amp; error.message) {
                  console.error(error.message);
              }
          }
          var connection = new 
          signalR.HubConnectionBuilder().withUrl('/adminHub')
         .configureLogging(signalR.LogLevel.Debug).build();      
          connection.start()
              .then(function () {
                  onConnected(connection);
              })
              .catch(function (error) {
                  console.error(error.message);
              });
      });
  &lt;/script&gt;```
  
  Debug: Sending handsha`enter code here`ke request.
  Debug: Hub handshake failed with error 'WebSocket is not in the OPEN state' during start(). Stopping HubConnection.
  HttpConnection.stopConnection(undefined) called while in state Disconnecting.
  Connection disconnected with error 'WebSocket is not in the OPEN state'.
  HubConnection.connectionClosed(WebSocket is not in the OPEN state) called while in state Connecting.
  </code></pre>