4
votes

I installed the SignalR package when our project was running .net 4.0. We since upgraded to 4.5 and I want to support WebSockets. I uninstalled Signal packages and reinstalled SignalR (per this answer). However the SignalR DLL versions (1.1.0/1.1.3) are identical in both cases.

Here is my configuration:

  1. ASP.NET 4.5
  2. IIS 8.0 (Windows Server 2012)
  3. WebSockets feature enabled on the server
  4. A WebSocket supporting browser (latest version of Firefox)

Even though I have all these required things, I still get this:

{"Url":"/signalr","ConnectionToken":"Yy6qHcSMMm4vPl9i3ungxJ5aa2P0SJh4UoU4pelAyFcMud0596UaeB6x8AmhZ2SxW_MPk23QXrKGkwar7LjLLnWlBZx1nokd6LRe96k8D-Oua3kSnKsyDa1RrPTE0n9FyaUO9rK3caLfue20Dmx5UkB9F2TKusPD4PDqQw2","ConnectionId":"b7b00e98-3128-4fbb-ba63-fb16f922f168","KeepAliveTimeout":20.0,"DisconnectTimeout":30.0,"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"}

I guess the important parts are:

"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"

Does this mean that I am not using WebSockets? What could I be missing?

Thanks so much.

3

3 Answers

4
votes

WebSockets are supported in all major versions of SignalR.

Therefore the question is "what is required for my SignalR application to use WebSockets?"

  1. ASP.NET 4.5
  2. IIS 8.0 (Windows Server 2012 or Windows 8)
  3. WebSockets feature enabled on the server
  4. A WebSocket supporting browser

Now that we've established what is required to have a WebSocket enabled application it seems that your missing the enabling of the WebSockets feature.

To enable WebSockets on your server follow the "Step by Step instructions" here.

Hope this helps!

1
votes

I know your problem - the same that hit ours!

Your problem is the client you are running from.

The client Windows stack must be > Windows7 to use WebSockets on a .Net Client

This caught us too! Browsers aren't affected as they have their own WebSocket stack, but the Windows .Net networking stack doesn't have WebSockets. Windows 8/Windows 2012 and IIS 8 fixes that. This is why the SignalR load tester (crank) can't use WebSockets when run on Windows7, only in Windows 2012 (regardless of server)

0
votes

We since upgraded to 4.5 and I want to support WebSockets. I'm running Windows 2012 Server, IIS 8, WebSockets feature installed on server and I still get this

Since you are using ASP.NET 4.5, IIS 8 and Windows Server 2012, the problem should be relying on how you migrated the project to .NET framework 4.5 or with the browser. Given that most of the modern web browsers support web sockets, I highly doubt your references are still for the .NET framework 4.0.

Try by creating a new project using .NET framework as 4.5. Simply setting the target using project properties sometimes doesn't update the assemblies.