Reputation: 21
The Situation I am using azure apim to proxy requests from client to my web app backend. I am succesfully forwarding the requests through the apim, mainly to hide my backend url in the request from the client. So just to expose the proxy url. However i am struggling with forwarding the signalR connection request through my Azure APIM. I need to do this because the negotiation handshake exposes my backendurl since im directly requesting the backend hub endpoint.
The attempted solution I've tried following this tutorial with LongPolling / ServerSentEvents: https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-howto-work-with-apim.
I've also added the APIM as a ClientEndpoint in the connection string that i use in my backend.
Any pointers whatsoever would be appreciated, seems like a niche problem and cannot really find any similar problems on the internet. Also any other solutions other than going through APIM would also be great!
Thank you.
Upvotes: 1
Views: 283
Reputation: 6464
POST https://{apimInstance}.azure-api.net/client/negotiate?hub=chatsamplehub
.var connection = new signalR.HubConnectionBuilder()
.withUrl("/chat",
{ transport: signalR.HttpTransportType.ServerSentEvents })
.build();
Upvotes: 0