-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Disable non-websocket transports for Blazor Server #33775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for contacting us. We're moving this issue to the |
FYI @BrennanConroy / @davidfowl |
If you do this you need to make sure that there is a way to opt back into other transports. You don't want to exclude those customers that can't run WebSockets for whatever reason. Do you have ideas of how to surface clean errors for this or is there asks for SignalR to help here? |
Some evidence of Blazor Server usage over non-websockets: https://twitter.com/HeyWellsy/status/1408275567489601540 |
@danroth27 Did you have anything in mind to ensure a 'good error experience'? Would a banner with a message like the following be appropriate? |
@TanayParikh can you detect that the websocket failed to connect? |
Yep, I'm able to catch the following exception:
Hence we can give a pretty specific error message about WebSockets being unavailable. |
I don't think that is the right error for this scenario. How did you get that? |
Running a basic script in my browser (before page load) that does: WebSocket2 = null;
WebSocket = null; Is it possible to use:
for browser testing as well? |
Ok, so that tests old un-supported browsers that don't support WebSockets at all. You also need to test connecting to a server that doesn't support WebSockets, which will be a slightly different error
Yes |
I'm assuming this is with client side enforcing WebSockets transports layer, in which case I emulated that now via: options.Transports = HttpTransportType.LongPolling and got:
I believe the underlying "ability" to detect WS not being available isn't hindered. Will ensure the final solution reflects both these use cases. |
Customers often have a bad time if they use Blazor Server with transports other than websockets. We should consider disabling non-websocket based transports for Blazor Server apps and provide a good error experience when websockets are not available.
The text was updated successfully, but these errors were encountered: