signalr

Null exception on HttpContext.Current.Request.Cookies when firing SignalR method

女生的网名这么多〃 提交于 2019-12-12 16:05:34
问题 I'm having an odd issue that I cannot seem to figure out or even understand properly. Basically I have a basic Authorisation method that fetches a security token (cookie) and compares it to the currently logged on user. When firing this from a SignalR method it throws a null exception but I know the user has security token. This works fine without SignalR. I'll provide code etc..To help understand the problem. The Architecture: Business Layer Presentation Layer //Located within the business

SignalR AuthorizeHubConnection

可紊 提交于 2019-12-12 15:41:49
问题 I want to authenticate users when they connect to the signalr server. The clients are javascript and are cross-domain. I tried using this example and the AuthorizeHubMethodInvocation gets called but the AuthorizeHubConnection never gets called. I created a new class AuthTicketAttribute where i override the two methods, public class AuthTicketAttribute : AuthorizeAttribute { public override bool AuthorizeHubConnection(HubDescriptor hubDescriptor, IRequest request) { return base

SignalR connection affinity in web-farm scenario

旧时模样 提交于 2019-12-12 15:27:01
问题 I have the following requirement for my application: a connection opens between JavaScript (client) and the server (ASP.NET). This connection must be able to send data back & forth for a medium amount of time and remain stateful (unlike REST calls) until it's closed. That is to say, for the duration of the connection, the client basically has affinity (in a web-farm scenario) with the server. I have read a lot about SignalR and WebSockets in general, but I can't figure out if this is how it

How to scale SignalR using Azure Worker Role and OWIN

*爱你&永不变心* 提交于 2019-12-12 14:09:43
问题 SignalR scales fabulously using Azure Web Roles. However, when I use a self-hosted OWIN project inside an Azure Worker Role, SignalR will begin to exhibit problems when multiple instances are added. For the record, my project uses Redis for the backplane. When increasing the Azure Worker Role instances beyond one, client connections will randomly fail with an error "The ConnectionId is in the incorrect format" . I believe this is caused when the negotiation for a single client spans multiple

Get SignalR User (Hub.Context) outside of hub

本小妞迷上赌 提交于 2019-12-12 13:45:27
问题 is there any way to get current signalR request user outside the hub? I can use Hub.Context.User inside of hub methods, but if hub method calls any other underlying layer? Wcf service call - an additional BehaviorExtensionElement is used to add wcf message header with current user identity name. public object BeforeSendRequest(ref Message request, IClientChannel channel) { request.Headers.Add(MessageHeader.CreateHeader( Constants.HeaderNames.SessionId, Constants.HeaderNames.HeaderNamespace,

Uncaught TypeError: Cannot read property 'server' of undefined

。_饼干妹妹 提交于 2019-12-12 12:20:38
问题 I'm trying to leverage SignalR while developing Chrome Extensions. I can run sample successfully but when I try to change the client from webpage to chrome extesion, I got some trouble. I define the connection the same as the sample like below: var chat = $.connection.myHub; console.log("start connect"); $.connection.hub.start().done(function () { // Call the Send method on the hub. console.log("Test"); //chat.server.send("extension", "start"); chat.server.send("succ"); }); But I always get

SignalR refuses to work

人走茶凉 提交于 2019-12-12 12:14:58
问题 Global.asax: void Application_Start(object sender, EventArgs e) { RouteTable.Routes.MapConnection<myconnection>("echo", "echo/{*operation}"); } myconnection.cs public class myconnection : PersistentConnection { protected override Task OnReceivedAsync(string clientId, string data) { // Broadcast data to all clients return Connection.Broadcast(data); } } ~/Pages/Messages.aspx <script src="http://code.jquery.com/jquery-1.7.min.js" type="text/javascript"></script> <script src="../Scripts/jquery

SignalR don't resolve JsonSerializer for incoming server call

百般思念 提交于 2019-12-12 12:09:28
问题 JRawValue(https://github.com/SignalR/SignalR/blob/master/src/Microsoft.AspNet.SignalR.Core/Json/JRawValue.cs) using: var serializer = JsonUtility.CreateDefaultSerializer(); Why not this? var serializer = GlobalHost.DependencyResolver.Resolve<JsonSerializer>(); Is it bug? JsonSerializer serializer = JsonSerializer.Create(settings); serializer.Converters.Add(new SomeConverter()); GlobalHost.DependencyResolver.Register(typeof(JsonSerializer), () => serializer); SomeConverter don't work for

SignalR WPF Client can't reach hub deployed on IIS when IIS runs on a different system

落花浮王杯 提交于 2019-12-12 11:32:14
问题 I just play a little bit with signalR. My application has only one simple hub which is stored in an ASP.NET Application and I wrote a WPF client , which interacts via the hubconnection and the created proxy with the ASP.NET Application. Everything works fine on my local PC. I deployed the ASP.NET Application on IIS . Now I am getting to the point... When I type the following into my browser on my own PC (pcthi-and) http://pcthi-and:8080/signalr/hubs I'll get what I want When I type the same

Prototype methods missing in IE via SignalR

家住魔仙堡 提交于 2019-12-12 11:19:43
问题 I've run into a problem dealing with prototype methods disappearing (in this case Array.prototype methods) only in IE and only when the array is coming through SignalR. I wrote a small/stupid but simple proof of concept web app that demonstrates this problem (code is all below). Notice that when you click "Update all clients" and then "Fruits containing the letter 'r'" the prototype methods in _list are missing causing an exception. In that case the array came from SignalR. Now when you click