signalr

SignalR connect to multiple servers

半城伤御伤魂 提交于 2019-12-05 13:44:21
Is possible to connect using Javascript client to more than one SignalR servers? For example: <script type="text/javascript"> $.connection.hub.url = 'http://server1.net/signalr'; var server1Hub = $.connection.server1Hub; $.connection.hub.start().done(function () { }); // i need to connect to server2 $.connection.hub.url = 'http://server2.net/signalr'; var server2Hub = $.connection.server2Hub; $.connection.hub.start().done(function () { }); </script> Trying to connect (again) the second time gives me an error: 'server1Hub' Hub could not be resolved. Can i create two instances of $.connection ?

Installing Asp.Net SignalR error while installing

孤者浪人 提交于 2019-12-05 13:32:29
I am trying to install SignalR in Visual Studio 2010 professional project. But I am getting this error: Could not install package 'Microsoft.Owin.Security 2.1.0'. You are trying to install this package into a project that targets ' .NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. F or more information, contact the package author. Try installing a different version of signal r with this command (via nuget package console) 'install-package Microsoft.AspNet.SignalR -Version 1.1.3'. Latest version of

How to implement SignalR if there is more than one iis server?

懵懂的女人 提交于 2019-12-05 12:51:00
Is there support for a cluster of iis nodes when using SignalR? Or do I need some third party message bus? Not yet, but they are working on it. It's planned for the 0.4 release. When ready, more information will probably be published in the wiki: SignalR and Webfarms on the wiki Edit2: Azure , SQL-Server and Redis are implemented. We just implemented this addon in our application and so far it works flawlessly. It uses a RabbitMq instance to distribute the messages to other servers and is really easy to configure. https://github.com/mdevilliers/SignalR.RabbitMq We haven't tried this on a

SignalR request pipeline, Hub lifetime

时光总嘲笑我的痴心妄想 提交于 2019-12-05 12:28:15
I am starting on signalR with asp.net webapi, and I am trying to understand the whole signalR request/connection pipeline and what is the lifetime of the hub and who creates and dispose the hub instance (does it gets created on every communication between client and server?) One of the reason is that we need to understand how we should be using an IoC contain in signalR request scenario, how we control the lifetime of the dependency correct specifically the ISession or DBContext . Hubs instances are created at every single request from a client. They are not kept around, therefore you should

SignalR MethodAccessException

自作多情 提交于 2019-12-05 10:59:59
i got this error when i try to debug a simple signalr app Attempt to access the method 'Microsoft.AspNet.SignalR.DependencyResolverExtensions.InitializePerformanceCounters(Microsoft.AspNet.SignalR.IDependencyResolver, System.String, System.Threading.CancellationToken)' by the method 'Microsoft.AspNet.SignalR.RouteExtensions.MapHubs(System.Web.Routing.RouteCollection, System.String, Microsoft.AspNet.SignalR.IDependencyResolver)' failed === Edited [Added more INFO] === ok added SignalR by typing this on Nuget Consolse Install-Package Microsoft.AspNet.SignalR -pre i added a repo here <?xml

SignalR Requests Throwing “Hub could not be resolved.”

做~自己de王妃 提交于 2019-12-05 10:45:42
I've been using SignalR since an early version and upgraded along the way however I have deployed my application to my Windows Server 2008 R2 production server and now the app crashes out with the " Hub could not be resolved." exception. edit: StackTrace Added: [InvalidOperationException: 'stockitems' Hub could not be resolved.] Microsoft.AspNet.SignalR.Hubs.HubManagerExtensions.EnsureHub(IHubManager hubManager, String hubName, IPerformanceCounter[] counters) +426 Microsoft.AspNet.SignalR.Hubs.HubDispatcher.Initialize(IDependencyResolver resolver, HostContext context) +716 Microsoft.AspNet

Custom Headers and Signalr: Asp.Net MVC4 Web Api

孤街醉人 提交于 2019-12-05 10:33:46
I am using signalr (version 2.0.0) in my asp.net mvc4 webapi project, Here to allow cross origin resource sharing, i use the following code in webconfig file <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <remove name="X-Powered-By" /> </customHeaders> Here is the client side signalr code for receiving data from server: $(function () { var nodePublishingHub = $.connection.nodePublishingHub; nodePublishingHub.client.NodePublished = onNewMessage; $.connection.hub.error(function (error) { $('#messages').append('<li>' + error + '</li>'); }); $.connection.hub.url = "http:/

CORS policy issue with angular 7 and ASP.NET core 2.2 using SIGNAL R

半腔热情 提交于 2019-12-05 10:21:45
My friend and I are running into CORS trouble with our API and angular client. We are trying to establish a link, we are using signalR and the client(Angular 7) registers himself to receive messages from server(ASP .NET core 2.2). In the browser console, I'm receiving this message : Access to XMLHttpRequest at ' https://ourEndpoint/CoordinatorHub/negotiate ' from origin ' http://localhost:4200 ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when

SignalR cross domain not working on browsers other than IE10

佐手、 提交于 2019-12-05 10:08:13
I am writing a web app using SignalR cross domain communication. I am using the latest version of SignalR, 1.0.1. Following is the code in the jQuery's document ready event: var connection = $.hubConnection(url); var proxy = connection.createHubProxy(hubName); connection.start().done(function () { proxy.invoke('serverMethod'); }); I tried running the application on Opera, Firefox, Chrome and IE 10. My OS is Windows 7. It works well on IE 10 and doesn't work on other browsers. I changed mode of IE using developer tools to IE 9, and it stopped working. The same code works on all browsers if I

Integrating SignalR with existing Authorization

坚强是说给别人听的谎言 提交于 2019-12-05 10:07:12
I've been working on a way of integrating SignalR Authorization Attributes with a custom authorization provider (called MVCAuthorization) I went down a few rabbit holes of trying to recreate an Authorization provider for hubs specifically, but that turned out to be far too complicated. So I was wondering, how I can integrate my existing Controller and Action Authorization with my SignalR Hubs and methods? DrSammyD I figured out that you can retrieve an IAuthorization provider. If you treat you hub as a controller, and your methods as your actions, all you have to do is create a SignalR