Are Web Sockets installed on the server?
blazorr.server.js Error: WebSocket closed with status code: 1006 (no reason given) on IIS server.
Hi everyone, I am developing a .NET 8 Razor Pages web app and I have added a Blazor-server-side component to it.
My app works when I run it in Visual Studio 2022.
However, when I publish it on a local IIS (I have tested it on IIS manager) it works fine (the component works but I got this warning message in the console:
Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling.
When I publish the app to a real IIS server, the component freezes and I got the following message in the console:
Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 (no reason given).'.
Error: Error: WebSocket closed with status code: 1006 (no reason given).
Error: Failed to start the circuit.
Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Blazor
2 answers
Sort by: Most helpful
-
-
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
2023-12-24T17:43:49.4933333+00:00 The server message says the server can not open a websocket, so it falling back to signalr polling.
the client code has probably been configured to only support websockets.
as suggested you need to enable websockets on the server, or enable long polling on the client.