You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to implement SignalR through Azure API Management and the issue is that as of now Azure API Management doesn't support different types of APIs for the same suffix, meaning that I can't set up SignalR to work primarily with WebSocket and ServerSentEvent/LongPolling as a fallback.
I'm currently investigating how to circumvent this and am wondering whether it would be possible in SignalR to setup two different URLs in my SignalR client, one for primary use with WebSocket, and the other when using any of the fallback protocols.
My idea is to do something like this
let connection = new HubConnectionBuilder()
.withUrl('url1', {transport: HttpTransportType.WebSockets})
.build();
connection
.start()
.catch(reason => {
if(reason === 'WebSocket not supported') {
connection = new HubConnectionBuilder()
.withUrl('url2')
.build();
connection.start();
}
});
An issue though is that I haven't found a reliable way to identify if the connection failed because WebSocket wasn't supported, is this possible?
Are there any better ways to do this?
Edit: Was able to find the error message by looking through the source code. Would there be any issues with doing something like this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm looking to implement SignalR through Azure API Management and the issue is that as of now Azure API Management doesn't support different types of APIs for the same suffix, meaning that I can't set up SignalR to work primarily with WebSocket and ServerSentEvent/LongPolling as a fallback.
I'm currently investigating how to circumvent this and am wondering whether it would be possible in SignalR to setup two different URLs in my SignalR client, one for primary use with WebSocket, and the other when using any of the fallback protocols.
My idea is to do something like this
An issue though is that I haven't found a reliable way to identify if the connection failed because WebSocket wasn't supported, is this possible?
Are there any better ways to do this?
Edit: Was able to find the error message by looking through the source code. Would there be any issues with doing something like this?
Beta Was this translation helpful? Give feedback.
All reactions