SignalR websockets not working on port 80

Viewed 115

I am having an issue with all browsers not making a websocket connection over port 80 to my IIS 10 webserver. If I RDP into the server and browse to the application or if I use ssl (443) it works just fine. It does successfully fallback to longpolling but I would like to strictly use websockets.

I am running an asp.net mvc 5 app using the 4.6 framework. Websockets are enabled on the server. Has anyone else ran into this issue or have any suggestions to resolve it?

EDGE error: jquery.signalR-2.4.3.js:1893 WebSocket connection to 'ws://' failed: Connection closed before receiving a handshake response

Firefox, Chrome error: jquery.signalR-2.4.3.js:1893 WebSocket connection to 'ws://' failed:

progress = $.connection.manifestHub;
console.log(progress);

progress.client.ShowProgress = function (message) {
  $('#ProgressMessage').width(message);
};

$.connection.hub.logging = true;
$.connection.hub.start({ transport: 'webSockets' }).done(function () {
      connectionId = $.connection.hub.id;
      $("#connectionId").val(connectionId);
      console.log(connectionId);
});
 var hubConfig = new HubConfiguration();
 hubConfig.EnableDetailedErrors = true;
            
 app.MapSignalR(hubConfig);
1 Answers

Your web server probably doesn't support WebSockets, probably because you're using a "proxy" server like ARR that just can't "route" WebSocket requests. Try disabling WebSockets on SignalR, if the issue persists it's a general SignalR issue, but at least you'll get a more specific error. If the problem stops, now you know it's a server problem.

Have you seen this thread? This is an answer provided by @Andre Pena. I tried and this helped me. I think this might help you.

Related