Marc Johnston
Marc Johnston

Reputation: 1286

ASP.NET Core 6 Angular SignalR template

What is the .NET template for a working ASP.NET Core 6 with SignalR and an Angular ClientApp that has a working WebSockets transport setup?

I can only get the ServerSideEvents transport to work.

dotnet new angular 

doesn't have a working SignalR with websockets ...

I can add SignalR, but the websockets don't work

Upvotes: 2

Views: 404

Answers (1)

Ramin Quliyev
Ramin Quliyev

Reputation: 380

You can configure clientside connection with your requirements. If you want websocket connection you have to configure like this:

  hubConnection =new HubConnectionBuilder()
  .withUrl('your hub url here',HttpTransportType.WebSockets)
  .withAutomaticReconnect()
  .build()

Upvotes: 1

Related Questions