signalr

Accepting ASP.NET Forms Authentication cookies in an OWIN-hosted SignalR implementation?

ⅰ亾dé卋堺 提交于 2019-12-05 07:17:28
I've got an self-hosted SignalR instance, using OWIN. I'd like to implement authorization. My users will already have logged into an ASP.NET MVC application, using Forms Authentication. Since the two applications will be available at the same URL, the cookies will be shared between the two. How do I accept a Forms Authentication cookie in a self-hosted SignalR application? Clarification: I'm talking about a browser accessing a self-hosted SignalR hub using the same credentials that were used to log into a separate (but related, and installed on the same host) IIS application. So, the question

Asp.Net Signal R - Detect Changes in Database ? Asp.net Web Forms

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 06:47:05
问题 So I have a List View inside an Update Panel Update Panel List View Email 1 Email 2 Email 3 ... I'm trying to do an inbox similar to GMAIL in ASP.NET, the only I'm struggling with is how to detect DataBase Changes (ie when a new message is sent) and Push that message into the ListView to simulate that the user has received a new message (just like gmail does) How do I use SignalR to detect database changes and push them into the List View using SignalR? Is it possible? 回答1: If you are using

How Can I Send Message To specific User with signalR

谁都会走 提交于 2019-12-05 06:39:37
I have some problem with signalR, I can not send message to specific User From Hub. I want to do like this: public void Send(string userToId, string userForId, string message) { IHubContext context = GlobalHost.ConnectionManager.GetHubContext<ChatHubs>(); //userForId - it is Session["UserId"] context.Clients.User(userForId).updateMessages(message); } I have already read this topic: http://www.asp.net/signalr/overview/guide-to-the-api/mapping-users-to-connections , but It's not clear for me, because I have not this var name = Context.User.Identity.Name; I have User information in Session

Send server message to connected clients with Signalr/PersistentConnection

你说的曾经没有我的故事 提交于 2019-12-05 06:35:38
问题 I´m using SignalR/PersistentConnection, not the Hub. I want to send a message from the server to client. I have the client id to send it, but how can I send a message from server to the client? Like, when some event happens on server, we want send a notification to a particular user. Any ideas? 回答1: The github page shows how to do this using PersistentConnections. public class MyConnection : PersistentConnection { protected override Task OnReceivedAsync(string clientId, string data) { //

SignalR cannot connect to Azure Redis on SSL

假装没事ソ 提交于 2019-12-05 06:29:39
I am currently hosting my redis cache server on Azure, and have signalR relying on it as the backbone using the following... GlobalHost.DependencyResolver.UseRedis("Server",port,"password","eventKey"); This works find on port 6379 (non-SSL) but my chat app breaks when I try to connect to the SSL port (6380) of my Azure Redis server, and the hub is never started. What could be the cause of this issue? Or am I doing something wrong? This is the error that appears on /signalr/connect in my browser net::ERR_CONNECTION_RESET You can try this: GlobalHost.DependencyResolver.UseRedis(new

Using SignalR as service layer for WebRTC

你。 提交于 2019-12-05 06:10:17
This is a follow-up to another question I asked, but with more precise information. I have two fundamentally identical web pages that demo WebRTC, one using XSockets as the backend signaling layer, and one using SignalR as the backend signaling layer. The two backends are fundamentally identical, differing only at the points where they (obviously) have different ways of sending data down to the client. Similarly, the TypeScript/JavaScript WebRTC code on the two clients is completely identical, as I've abstracted out the signaling layer. The problem is that the XSockets site works consistently,

SignalR wth gzip compression

淺唱寂寞╮ 提交于 2019-12-05 06:07:30
Having some problem developing a SignalR client for a Hub hosted in asp.net website with gzip compression enabled. Since we are using IIS compression, the response from SignalR also gets compressed, but, the client does not understand the response and we get a Json parsing error on the client side. SignalR internally uses HttpWebRequest to make make http requests and HttpWebRequest can be configured to automatically decompress the response using AutomaticDecompression property. So, if somehow I can get hold of the HttpWebRequest object used by SignalR to make the request, I should be able to

How can I keep trying to subscribe to signalR from Angular service if connection fails?

人走茶凉 提交于 2019-12-05 05:57:08
问题 How can I keep attempting to connect to signalR in a safe way that allows a few hundred milliseconds (at least) in between attempts until the connection is established and if so, could someone provide a better way pf dealing with the various stages of connectivity to the web-sockets? We are using signalR on a .NET backend and I am trying to use it to display real-time push notifications in an Angular 4 UI. It works great when it connects, but there is a problem where sometimes it takes 2-3

How to securely send a message to a specific user

匆匆过客 提交于 2019-12-05 05:33:06
I am using ASP.NET MVC 5 and SignalR. I want to send a message to a specific user. I have followed the method which is explained in this tutorial (also suggested by this answer ). I have overridden IUserIdProvider , to use UserId as connectionId . public class SignalRUserIdProvider : IUserIdProvider { public string GetUserId(IRequest request) { // use: UserId as connectionId return Convert.ToString(request.User.Identity.GetUserId<int>()); } } And I have made the change to my app Startup to use the above custom provider: public partial class Startup { public void Configuration(IAppBuilder app)

一、Signalr WebApi客服-客户链接

自闭症网瘾萝莉.ら 提交于 2019-12-05 04:26:47
一、前端客服代码 <!doctype html> <html> <head> <meta charset="utf-8"> <title>LayIM测试</title> <link rel="stylesheet" href="./layui/css/layui.css" media="all"> <link rel="stylesheet" href="./contextMenu/contextMenu.css"> </head> <body> <script src="./layui/layui.js"></script> <script> layui.config({ base: './contextMenu/' //扩展 JS 所在目录 ,version: true }).extend({ ext: 'contextMenu' }); //演示代码 layui.use('layim', function(layim){ var layim = layui.layim; layim.config({ init: { //配置客户信息 mine: { "username": "访客" //我的昵称 ,"id": "100000123" //我的ID ,"status": "online" //在线状态 online:在线、hide:隐身 ,"remark": "在深邃的编码世界