-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
How to make Blazor Server SignalR connection use a different URL? #59546
Comments
how to make your blazor server app start the signalr channel in a different url
Done. Easy. But hard to find the instructions. |
How to make your Blazor Server application run in a container app behind APIM
The instructions are good but misleading because they mention "Azure SignalR Service" but they are valid too for a NORMAL app that doesn't use SignalR Service but just normal SignalR. Also, in my case, I had APIM configured to run the entire website too, but it DID NOT WORK to handle the websocket negotiation... so I had to add yet another HTTP API. In my case I had:
With these last two negotiation worked! |
@pablosantosluaces thanks for contacting us. Your solution is correct as for configuring the Blazor connection endpoint URL. As for the APIM solution, the approach looks ok at first glance. @guardrex can you make sure that the docs are up to date to reflect #59546 (comment) |
Thanks :-) |
My question is: how to configure the endpoint used by signalr in Blazor server?
Scenario
Error: 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.
So, probably the solution is to define an extra WebSocket API in APIM and make the SignalR code go through it.
But, in order to achieve it, I need the javascript side of things to point to something like MYSITE/signalr/_blazor?id=xxx intead of wss://MYSITE/_blazor?id=xxxx
How can I achieve this?
There are some random answers here and there, and "probably" this is the way to achieve it:
But it would be good to be able to find a proper example instead of stackoverflowing this.
@javiercn :-)
Extra info
I found some info about how to do it but the docu is not very clear here: https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/startup?view=aspnetcore-9.0 it mentions something, but where is the detailed info of each option?
It does mention this, but where are all the circuit options??
The text was updated successfully, but these errors were encountered: