I have two different blazor server apps hosted under same site in IIS. One of them works correctly with no websocket connection errors.The other blazor app when trying to make a request to api endpoint gives below errors:
WebSocket connection to 'ws://xx.xxx.com/xxx/_blazor?id=4e6Ml59u47yaMwtOdg5nhA' failed
Failed to start the transport 'WebSockets': Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.
The circuit failed to initialize.
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)Error: Invocation canceled due to the underlying connection being closed.
I noticed that if I browse the same application within the server environment in which it is hosted, it works perfectly with no web socket errors.
I have made sure that the websockets are enabled in IIS & the api endpoint url is correct.