Skip to content

Blazor WebAssembly SignalR does not use WebSocket transport in net5.0-rc1 #25913

@campersau

Description

@campersau

Describe the bug

When using Blazor WebAssembly SignalR does not use WebSocket transport but Long Polling instead.

To Reproduce

Checkout https://github.com/campersau/blazor-signalr-test which includes a server and clients (important file is Index.razor). Looking at the dev tools only long polling fetch requests are being made and no websocket connection.

image
HAR file

Console output when adding logging to SignalR client:

Microsoft.AspNetCore.Http.Connections.Client.Internal.LongPollingTransport: Starting transport. Transfer mode: Text.
Microsoft.AspNetCore.Http.Connections.Client.HttpConnection: HttpConnection Started.
Microsoft.AspNetCore.SignalR.Client.HubConnection: Using HubProtocol 'json v1'.
Microsoft.AspNetCore.SignalR.Client.HubConnection: HubConnection started.

Further technical details

  • ASP.NET Core version: 5.0.100-rc.1.20452.10
  • Microsoft Visual Studio Enterprise 2019 Preview Version 16.8.0 Preview 3.0

Metadata

Metadata

Assignees

Labels

area-signalrIncludes: SignalR clients and servers

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions