Disable Long Polling Fallback Transport for Blazor Server #470
Labels
6.0.0
Announcement
Breaking change
Documented
The breaking change has been published to the .NET Core docs
Milestone
Disable Long Polling Fallback Transport for Blazor Server
Long Polling is a fall-back transport utilized when WebSockets aren't available. This can lead to a degraded user experience. Thus, the Long Polling fallback has been removed, and both the client and server now support only WebSockets by default.
Version introduced
.NET 6 rc 1
Old behavior
If WebSockets are unavailable for a circuit (ex. network issues or browser incompatibility), Long Polling is used instead.
New behavior
Unable to connect, please ensure you are using an updated browser that supports WebSockets.
Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection.
An unhandled error has occurred.
Console Error:Unable to initiate a SignalR connection to the server. This might be because the server is not configured to support WebSockets. To troubleshoot this, visit https://aka.ms/blazor-server-websockets-error.
An unhandled error has occurred.
Reason for change
Improve overall end-user-experience by enforcing WebSocket use.
Recommended action
Ensure WebSockets are functioning as expected with your application. If you must use Long Polling, the following client and server side changes must be made:
Server Side
In
Startup.cs
, replaceendpoints.MapBlazorHub()
with:Client Side
In
Pages/_Layout.cshtml
, update theblazor.server.js
script tag to include theautostart="false"
attribute:Below the
blazor.server.js
script tag, add the following snippet. WebSockets (1) and Long Polling (4) are the supported HTTPTransportTypes.Category
Affected APIs
Not detectable via API analysis
Issue metadata
The text was updated successfully, but these errors were encountered: