Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to connect signalR error during websocket handshake code : 400

i have signalR websocket to show notification

the code for connecting like :

$.connection.hub.start().done(function(){
  console.log("connected");
});
            
var notif = $.connection.notificationHub;
console.log(notif);

after deploying to a production server signalR is not working and showing this error in console : console errpr

production server is using iis 8.5 what makes this error? thank you.

like image 612
Mamen Avatar asked Jul 03 '16 04:07

Mamen


People also ask

Does SignalR use WebSockets?

ASP.NET Core SignalR is a library that simplifies adding real-time web functionality to apps. It uses WebSockets whenever possible. For most applications, we recommend SignalR rather than raw WebSockets.

How many connections SignalR can handle?

In the default mode, the app server creates five server connections with Azure SignalR Service. The app server uses the Azure SignalR Service SDK by default. In the following performance test results, server connections are increased to 15 (or more for broadcasting and sending a message to a big group).

What is SignalR connection?

SignalR handles connection management automatically, and lets you broadcast messages to all connected clients simultaneously, like a chat room. You can also send messages to specific clients.


1 Answers

Do you have this tag in your web.config file within the <system.web> tag?

<httpRuntime maxRequestLength="40960" targetFramework="4.5" requestValidationMode="2.0" />

If that doesn't work try failing over to long polling instead of WebSockets in SignalR and see if you get the same error.

like image 157
jeanfrg Avatar answered Oct 05 '22 23:10

jeanfrg