signalr

SignalR responses overwriting headers

你。 提交于 2019-12-10 13:21:08
问题 I've built a simple SignalR hub that lives within a WebAPI service, I've included all the required CORS attributes on both WebAPI and SignalR. My WebAPI endpoints are all working as expected but SignalR isn't. I've tried all I can think of and all I can find online but nothing works, I already tried this answer, and this other to no solution. My SignalR extension method looks like this public static IAppBuilder UseSignalrNotificationService(this IAppBuilder app) { var config = new

Forms authentication with SignalR

╄→гoц情女王★ 提交于 2019-12-10 13:17:25
问题 I have gone through wiki on SignalR and still can't figure out how to do Forms authentication with SignalR. I'd like to invoke a call to a hub (or persistent connection) with username/password and be able to return a redirect to an authenticated page, along with setting forms authentication cookie. 回答1: Don't do forms auth through SignalR. Do it outside of SignalR (as you would normally) and then you can check to make sure incoming calls, and subscribers to your hub are authenticated. 来源:

SignalR: “The user identity cannot change during an active SignalR connection” error with windows auth website

大憨熊 提交于 2019-12-10 13:15:44
问题 I have an MVC 5 website running signalR 2.1.0 using Windows Authentication. Because I'm using windows auth login/logout is handled automatically by IIS. Occassionally I'm getting a 403 error saying "Unrecognized user identity. The user identity cannot change during an active SignalR connection." This doesn't happen all the time, and I can't seem to find a pattern to when it does and does not work. Has anyone else encountered this? Here is the code on the view: <script type="text/javascript">

Is signalr 3.0 beta available yet for 2015?

主宰稳场 提交于 2019-12-10 12:47:32
问题 Would like to port Signalr code into vnext project but I do not see the references for SignalR 3.x. 回答1: You would need to reference the package in your project.json file, like so: "dependencies": { ... "Microsoft.AspNet.SignalR.Server": "3.0.0-*" } A vNext SignalR sample: https://github.com/aspnet/BugTracker 来源: https://stackoverflow.com/questions/26982658/is-signalr-3-0-beta-available-yet-for-2015

SignalR for Android: how can I pass dynamic class to SubscriptionHandler1

我的未来我决定 提交于 2019-12-10 12:23:56
问题 I have a method startSignalR calling mHub.on("broadcastMessage", new SubscriptionHandler1<CustomMessage>() { @Override public void run(final CustomMessage msg) { final String finalMsg = msg.UserName + ": " + msg.Message; System.out.println(finalMsg); } } , CustomMessage.class); Now I wanna a dynamic class (not only CustomMessage) passed to the method, I have used Class <T> tClass as parameter of "startSignalR", but get error at new SubscriptionHandler1<tClass>() Would you please tell me how

Is there a way to check if a SignalR server/hub is active/up/ready/accepting connections via server side code?

懵懂的女人 提交于 2019-12-10 11:59:23
问题 I have a console application that connects to SignalR Hub and sends messages, etc. Works perfectly fine. Today, when I started my console app, I forgot to -also- start my SignalR hub (so there was no hub up, active and accepting/sending messages). Of course, I got a low level connect error: Server is actively refusing connections, etc... Is there a way that I can check to see if the Hub is online, active and accepting connections? Or is the only way to use a try/catch and make the assumption

Autofac - SignalR with OWIN. getting reference to the ContainerBuilder

流过昼夜 提交于 2019-12-10 11:49:28
问题 I have an existing MVC 4 application that uses Autofac and I have other assemblies that have autofac Modules in. Without SignalR/autofac integration, my application works perfectly as far as IOC is concerned. I have added in SignalR hubs which I am trying to inject dependencies into via the constructor. I have followed the documentation and implemented the code example from. http://autofac.readthedocs.org/en/latest/integration/signalr.html Which results in this following class: public class

SignalR Android access localhost

柔情痞子 提交于 2019-12-10 11:47:43
问题 For some reason I cannot make make android app connect to my server (on localhost) The problem is (probably) not in the code,the exact same code runs fine in a simple java application I get an InvalidHttpStatusCodeException Bad Request - Invalid Hostname HTTP Error 400. The request hostname is invalid. I tried using another emulator ,Genymotion(I changed the IP to http://192.168.56.1... ) java.util.concurrent.ExecutionException: microsoft.aspnet.signalr.client.transport.NegotiationException:

push data from server to client with specified Id signalR

久未见 提交于 2019-12-10 11:47:37
问题 I received data from different server to my Hub class. Each data has its own ID. Whenever data comes to the server hub, it push my data to the client. This is like job progress. I want to send each ID to the client with unique hub id., How do I filter the message from the server? I used in this way Clients.Client("ID1").send(data); Or I have to specify in caller property? Anyone can help me. With Regards, Shanthini 回答1: You can use ConnectionId to identify the client. When new client is

SignalR 2.0 in VS2012 registration and Dependency Injection

南楼画角 提交于 2019-12-10 11:46:19
问题 I was able to work with SignalR 1.13 with my own DI like this: //Funq container GlobalHost.DependencyResolver = new FunqDependencyResolver(container); RouteTable.Routes.MapHubs(); Now with the new version 2.0 I am stuck. using Microsoft.Owin; using Owin; //SignalR 2.0 no longer uses RouteTable.Routes.MapHubs(); [assembly: OwinStartup(typeof(SignalRChat.Startup))] namespace SignalRChat { public class Startup { public void Configuration(IAppBuilder app) { app.MapSignalR(); } } } (New SignalR 2