title: Not able to connect with SignalR hub using websockets transport type
body: <p>I have an angular6 / Material design application . I'm trying to connect to a webservice(Service Fabric + .net core) using signalR . But i get the following error ( i've tried in Firefox and in Chrome) :</p>
  <blockquote>
  <p>&quot;Error: Failed to start the transport 'WebSockets': undefined&quot;</p>
  <p>&quot;Error: Failed to start the connection: Error: Unable to initialize any of the available transports.&quot;</p>
  </blockquote>
  <p>In Chrome , I also have this error in addition to the 2 previous ones ( in the example i replaced the token by xxx):</p>
  <blockquote>
  <p>WebSocket connection to 'wss://localhost:20003/supervisor?id=xxxx&amp;access_token=xxxx' failed: HTTP Authentication failed; no valid credentials available</p>
  </blockquote>
  <p>Here is my angular code :</p>
  <pre><code>//Creating Connection
  this.hubConnection = new HubConnectionBuilder()
              .withUrl(this.hubUrl, {
                  accessTokenFactory: () =&gt; {
                    return window.localStorage.getItem('token'); }
                    , transport: (HttpTransportType.WebSockets)})
              .configureLogging(LogLevel.Information)
              .build();   
  //Starting Connection 
   this.hubConnection
          .start()
          .then(() =&gt; {
              console.log('connection succeeded')
          })
          .catch((e) =&gt; {
              console.log('Error while establishing connection  ', e);
          }); 
  </code></pre>
  <p>In my webservice , i have added in startup.cs the following code:</p>
  <pre><code>services.AddCors(options =&gt; options.AddPolicy(&quot;CorsPolicy&quot;, builder =&gt;
          {
              builder
                  .AllowAnyMethod()
                  .AllowAnyHeader()
                  .AllowAnyOrigin()
                  .AllowCredentials();
          }));
  
  //in configure() method
  app.UseCors(&quot;CorsPolicy&quot;);
  app.UseWebSockets();
  app.UseAuthentication();
  </code></pre>
  <p>Please let me know if there is a way to fix this issue</p>