Last post Aug 15, 2016 08:13 PM by sqenixs
Aug 14, 2016 02:21 AM|sqenixs|LINK
I have been trying to get websockets to work on my server side using Signal R 1.2.2 on Windows 7 and .NET 4.0. For a bunch of reasons out of my control I am limited to Windows 7 and .NET 4.0. At first from all of my research I thought it was impossible
to do this however I found
https://stackoverflow.com/questions/17957949/does-self-hosted-signalr-require-windows-server-2012-in-order-to-use-websockets/ which gave me some hope. Basically you override the persistent connection class with your own and point the websocket server url
to a custom websocket server, which I have:
public override Task ProcessRequest(HostContext context)
// Override what SignalR will be telling you internally and point to your own Web Socket Server.
context.Items[HostConstants.SupportsWebSockets] = true;
context.Items[HostConstants.WebSocketServerUrl] = "ws://localhost:3000";
However I haven't figured out how to fully get it to work. This may be due to the OWIN parts. When I call WebApp.Start from Owin, I am still getting an http listener and my client (also Signal R 1.2.2) is connecting via http even when I set the url to
be a websocket and the transport type to be a websocket. Perhaps I need to change my client to 2.0+? Or make changes to OWIN for this. I know what I am doing is something that Signal R wasn't designed for but I believe it is (yet) possible without rewriting
the source code of Signal R.
Aug 15, 2016 02:33 AM|Fei Han - MSFT|LINK
Firstly, you could read this article to know what clients and servers are supported by SignalR.
Secondly, you could try to use the latest version of SignalR.
Aug 15, 2016 08:13 PM|sqenixs|LINK
You misunderstand what I am trying to do. And I cannot use the latest version because I must use .NET 4.0. In any case, I figured it out. As long as I run an HTTP listener for the negotiate request, then I was able to successfully get data over a websocket