signalr

signalR CORS - IE client gets 403 'Forbidden: JSONP is disabled'

邮差的信 提交于 2019-12-06 09:58:14
We implemented SignalR 2.0 hub with CORS enabled. Javascript clients on Firefox and Chrome are running fine. IE 10 gets error 403. Any help will be appreciated. Thank you and regards. halter73 While IE 10 (but not IE ≤9) should support CORS, if you find yourself needing to use JSONP you can enable it when you call MapSignalR . Enabling JSONP allows your SignalR app to be accessed from any origin while sending cookies/credentials. With CORS, you can limit which origins are able to access your SignalR app, whether or not cookies/credentials should be sent with cross-origin requests and more.

SignalR Groups not getting data

坚强是说给别人听的谎言 提交于 2019-12-06 09:01:00
Hi I am having a problem where my signalR clients who are in a group do not get the information sent. I have tried this in two ways and both not working. On web page loaded the client will call the server to get the group name and then call a method on the hub to join the user in that group. JavaScript..... var connectionOpen = false; var myHub; $(function () { myHub = $.connection.myHub; myHub.client.showMessage = alertMessage; $.connection.hub.start(function () { connectionOpen = true; joinGroup(); }); }); function joinGroup() { $.ajax({ url: 'Controller/GetGroupName, type: 'POST', success:

How to persist SignalR connection ID

我与影子孤独终老i 提交于 2019-12-06 08:37:15
问题 I’m trying to build a chat apps whereby users id are represented by their auto generated signalR connection id. On page refresh, the connection id changes when a new connection is instantiated. Is there a way to persist the state of the connection id of a user until the browser session is ended (i.e until he ends his session on client). Any guide or documentation? It really would help. i am new in signalr. so trying to know many things searching Google. from this url i got a similar snippet

Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'></script>

别说谁变了你拦得住时间么 提交于 2019-12-06 08:17:00
问题 There are two pages: Login.aspx and Profile.aspx, which are built using HTML and AngularJS. The login.aspx page uses ng-view to get the template of Login-view or Signup View. The code used is: <head> <title></title> <base href="/Login.aspx" /> <link href="StyleSheet/Login_css.css" rel="stylesheet" /> <script src="JscriptVendors/angular.min.js"></script> </head> <body ng-app="JouralApp_login"> <div ng-view></div> <script src="Jscript_Angular/Model.js"></script> <script src="Jscript_Angular

SignalR on Xamarin.iOS - randomly not able to call Hub method

自闭症网瘾萝莉.ら 提交于 2019-12-06 08:11:11
问题 I have a simple Hub running in Azure, that I have working perfectly from a console app in Windows. I just built a simple test Xamarin.iOS app, and it is giving some strange behavior. Randomly on LTE/Wifi or Simulator/Device - invoking a hub method fails with There was an error invoking Hub method X Randomly about 50% - everything works perfectly just like the console app on Windows - the two are even sending messages to one another I tested this on an iPhone 5S and iPhone 4S for devices. Any

Can someone provide a CorsPolicy implementation with an explicit Origins list?

拈花ヽ惹草 提交于 2019-12-06 07:59:30
问题 Referring to the SignalR Hubs API Guide indicates the following information in the configuration comments: // Setup the CORS middleware to run before SignalR. // By default this will allow all origins. You can // configure the set of origins and/or http verbs by // providing a cors options with a different policy. map.UseCors(CorsOptions.AllowAll); however, the Origins property of System.Web.CorsPolicy has a private setter, no constructor that allows origins to be injected, and no exposed

SignalR: How to stop creating new connection on page reload

耗尽温柔 提交于 2019-12-06 07:41:23
问题 Hi i am developing a chat application along with some other pages in my application. once i login i am maintaining the session of the user. My main intention is that user should get notification whenever another user connects to server. The problem that i am facing is whenever i navigate to some other page in my application the connection is lost. How to stop this behaviour and continue the connection until user logs out. I am using SignalR 2.0 in ASP.NET MVC4 project, any help?? 回答1: Each

How to modify the SignalR Hub URL

两盒软妹~` 提交于 2019-12-06 07:01:34
问题 I would like to use a different base hub URL than ~/signalr/hubs . How to modify this url, for example to ~/api/hubs ? Second question, may I use a different url for a different sets of hubs? For example: ~/api/chat/hubs ~/api/email/hubs Thanks. 回答1: Ran across this, possible now with 0.5+: RouteTable.Routes.MapHubs("~/api"); 回答2: No you may not, it's hardcoded in the source. No the proxy generated is for all hubs. 回答3: Well this question is old (4 years? wtf.. I always thought web sockets

Best Practices for reconnecting a disconnected SignalR client (JS)

拥有回忆 提交于 2019-12-06 06:45:07
问题 I'd like to improve the resilience of my clientside implementation of a signalR client. Currently, I do this: hub.server.sendClientNotification(string, appSettings.username()); However occasionally, an exception related to connectivity is thrown because either the server is not responding or the client's internet connection has become unusable. I'd like to solve this by queuing up requests and then doing something like this: try { // pop from queue hub.server.sendClientNotification(string,

SignalR and serializing object array

我怕爱的太早我们不能终老 提交于 2019-12-06 06:44:26
问题 I'm new to SignalR and have done a simple test hack. I wish to serialize an object array with typed objects. By default SignalR has configured the JSon.NET serializer to not provide with type information. And I found that I could register a custom serializer in the DependencyResolver by: var serializer = new EventHubJsonSerializer( new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects, TypeNameHandling = TypeNameHandling.Objects }); GlobalHost