signalr

SignalR: Server doesn't receive any requests if more than X connections established in one browser

£可爱£侵袭症+ 提交于 2019-12-14 03:42:29
问题 Good day. Background : ASP.NET MVC 3 / SignalR. I'm developing typical chat component which will be used in a big portal. I wrote small emulator which opens new window with chat component and new SignalR connection in it. The problem: Everything works fine, but: Suddenly i noticed that if i open more than X windows/tabs with same component in one browser - server stops to receive any responses from any clients connected with it. The X is : 5 for IE and Chrome 14 for FF. I suppose it's a

SignalR throws 405 error on notify/negotiate request

╄→尐↘猪︶ㄣ 提交于 2019-12-14 02:34:05
问题 I connect to the server with angular like this: this._hubConnection = new signalR.HubConnectionBuilder() .withUrl(location.protocol + '//localhost:5000/notify') .configureLogging(signalR.LogLevel.Information) .build(); There is no problem with the code or the host. The request works. But then the library makes an additional call to: http://localhost:5000/notify/negotiate Then I get this error: HTTP ERROR 405 The full error in the client is: Failed to load http://localhost:5000/notify

Cannot read property 'chatHub' of undefined SignalR Hub

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-14 02:22:18
问题 i'm try to learn signalr and this error i'm founded it. Cannot read property 'chatHub' of undefined. $(document).ready(function () { var chat = $.connection.chatHub; $.connection.hub.start(); }); and hub file is: namespace TestSignalR.Web.Hubs { public class ChatHub : Microsoft.AspNet.SignalR.Hub { public void Send(string msg) { ChatData chat = new ChatData(); chat.Msg = msg; chat.UserName = HttpContext.Current.User.Identity.Name; chat.Date = "♣ at " + DateTime.Now.ToString("hh:mm tt");

SignalR Azure Cloud Service with Service Bus

可紊 提交于 2019-12-14 02:14:58
问题 I have built a simple Chat application using SignalR followed the tutorial there, which works great. Then I followed the tutorial of SignalR Scaleout with Azure Service Bus, also from Microsoft. So I have completed all the following steps: Created a new Cloud Service on Azure Portal Created a new Service Bus namespace on Azure Portal Created a Windows Azure Cloud Service with a SignalR ASP.NET Web Role Setup the SignalR Web Role running on 2 instances (VM Size: Small) Deployed the Cloud

Passing connection token is secure or hacky from signalr js client side to hub function

旧时模样 提交于 2019-12-14 00:51:03
问题 i read this article http://www.asp.net/signalr/overview/security/introduction-to-security#connectiontoken JS Client $.connection.hub.qs = { "token" : tokenValue }; $.connection.hub.start().done(function() { /* ... */ }); .NET Client var connection = new HubConnection("http://foo/", new Dictionary<string, string> { { "token", tokenValue } }); Inside a Hub you can access the community name through the Context: Context.QueryString["token"] Setting Headers on the .NET Client var connection = new

Ways to mock SignalR Clients.Group in unit test

巧了我就是萌 提交于 2019-12-14 00:25:58
问题 I'm writing mock test cases for SignalR application. I just started with the help of Unit Testing SignalR Applications, but my requirement is little bit different that example shown there. Following is the code I have done after googling. SignalRHub public class HubServer : Hub { [HubMethodName("SendNofication")] public void GetNofication(string message) { try { Clients.Group("Manager").BroadCast(message); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } Unit Test public

The remote certificate is invalid according to the validation procedure - can`t solve this

旧街凉风 提交于 2019-12-13 23:59:09
问题 I hang unsuccessfully for days on this problem and not a single answer to different posts at different websites helped me so solve it. I am working on a Windows 10 System and implementing with VisualStudio 2017. With AspNetCore I`ve implemented the following projects: 1.) Web.AuthServer: IdentityServer4 for authentication. 2.) Web.ApiServer: The first SignalR-Server. 3.) Web.ApiSwitch: The second SignalR-Server. It has a HostedService with 2 SignalR-Clients as a "bridge" between the two

signalr group add

穿精又带淫゛_ 提交于 2019-12-13 22:28:22
问题 can i add e.g. username instead of connection.id . does it work? i'm asking this because over ConnectionId i can't send notification to the user, because ConnectionId always is changes? Groups.Add("my_username", "mygroup1); 回答1: No you cannot, you must use a ConnectionID. You can however do the following. On your hub store a list of users mapped to connection IDs: static ConcurrentDictionary<string, User> _users = new ConcurrentDictionary<string, User>(); Then after a client connection has

Authorization in SignalR 2.0

纵饮孤独 提交于 2019-12-13 19:09:59
问题 I have a Web server with forms authentication and another server that hosts the SignalR Hubs. Using the forms authentication cookie I want to extract the current user using the code below. This would be possible using a HttpModule, but when using SignalR a HttpModule cannot be used. Is there any other way to archive what I want to do? public class AuthorizationHubModule : HubPipelineModule { public AuthorizationHubModule() { } protected override bool OnBeforeConnect(IHub hub) { var cookies =

Unable to implement p2p chat using SignalR in Android

时光怂恿深爱的人放手 提交于 2019-12-13 14:17:53
问题 I have sucessfully implemented SignalR in my android application. and message broadcasting is also working fine. i want to implement p2p chat in my application using SignalR. i checked clients library in Asp.Net, i also tried Google but not getting required output. i checked SignalR, SignalA and SignalJ. i think SignalJ is useful but unable to resolve some library issue like scala and akka can anyone please help me. how can i implement p2p chat using SignalR in my android application? Thank