Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do I get signalR working in umbraco 8? I followed the tutorial below and it works in a regular MVC .NET Framework application but doesn't with umbraco installed.
I did exactly the same thing when umbraco was installed compared to when it was a simple mvc application. Only thing I needed to do differently was inheriting from UmbracoDefaultOwinStartup.
So the actual problem with signalR is that I seem to be stuck on the negotiate request. So after a while I get the "Error during negotiation request" message.
Can someone guide me on how to get it to work? Thanks in advance!
I'm probably going to end up with a lot of links here, so right up you can see a working v8 signalR sample in the uSync8 code. :
Js Hub : https://github.com/KevinJump/uSync8/blob/v8/8.2/uSync8.BackOffice/App_Plugins/uSync8/uSyncHub.js
Controller setup / receive: https://github.com/KevinJump/uSync8/blob/v8/8.2/uSync8.BackOffice/App_Plugins/uSync8/settings/uSyncController.js#L281
C# Hub : https://github.com/KevinJump/uSync8/blob/v8/8.2/uSync8.BackOffice/Hubs/uSyncHub.cs
c# Setting up a connection (with a client id usally passed via ApiController)
In terms of special setup, the thing to know is there is already a SignalR hub setup inside Umbraco before you do anything, the url /backoffice/signalr/hubs returns the hub js code that gives you references to any defined hubs and this needs to be loaded before you can do anything in the JS (see the uSyncHub.js). and you can also load the signalR client scripts from /lib/signalr/jquery.signalR.js
When you start a SignalR hub all the connections are initialized (or reset), but you can't guarantee that your code will be the first to try this, so you should check that things exist before running through the setup (again uSyncHub.js has the logic for this - if you don't do this, you can break things like Umbraco deploy/or preview).
Back end wise, you need a Hub class to hang your end point off, it doesn't actually need to do anything, but once you have something inheriting the Hub class - the Umbraco signalR script will pick it up.
In-order to keep messages private a single client and the server you will need to get the clientId in the js. (see the getClientId function here), you can then pass this, and at the other end when you setup the hub connection - passing in the client Id will keep the messages 1-to-1 if you don't pass a clientId it will broadcast the message to all clients (not always a bad thing).
the main thing was working out what uSyncHub.js needed to do, so looking in there will probably get you most of the way.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted