signalr

SignalR typescripf declaration file

随声附和 提交于 2021-02-07 11:41:32
问题 I've started using typescript, easily found declaration (d.ts) files for angular.js and jquery. Can't find one for SignalR jquery though. Can you guys help me. I could just create an interface that extends JQuery but somehow it's not working... var hub = $.connection.myHub it's complaining about connection thing... says "The property 'connection' doesn't exist on value of type 'JQueryStatic'" 回答1: DefinitelyTyped has a complete TypeScript definition for SignalR. Just updated the link, thanks

SignalR Hub Authorization for Blazor WebAssembly with Identity

人走茶凉 提交于 2021-02-07 03:49:04
问题 I have set up a SignalR Blazor WebAssembly app with JWT authentication, configured to send the token through query field access_token. At the server, I see that it is assigning the context.Token from this value. However, for the hub, annotated with [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)], I am getting 401. Why is it not authorizing? This is the code for the hub: https://github.com/jonasarcangel/SignalRAuthTest/blob/master/SignalRAuthTest/Server/SignalR

SignalR Hub Authorization for Blazor WebAssembly with Identity

六眼飞鱼酱① 提交于 2021-02-07 03:46:51
问题 I have set up a SignalR Blazor WebAssembly app with JWT authentication, configured to send the token through query field access_token. At the server, I see that it is assigning the context.Token from this value. However, for the hub, annotated with [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)], I am getting 401. Why is it not authorizing? This is the code for the hub: https://github.com/jonasarcangel/SignalRAuthTest/blob/master/SignalRAuthTest/Server/SignalR

WPF SignalR Server

僤鯓⒐⒋嵵緔 提交于 2021-01-29 19:52:15
问题 I'm really stuck and need some help. I have a .NET Core 3.1 WPF application, which decodes basketball scoreboard data and now I need to send this data over to .html file. The .html file is opened once through CasparCG server as a template and needs to somehow have it's data update real-time. I currently thinking that the best way to do this is to have a SignalR server in the WPF app and a html template running a SignalR client. One of the requirements is that I have to be able to start and

How can I make one to one chat system in Asp.Net.Core Mvc Signalr?

≡放荡痞女 提交于 2021-01-29 19:28:00
问题 I want to implement private chat system with Mssql Database. This codes works as public when I send the message, message is appears all clients. But I want to one to one chat system. One user enter the receiver id which stored in database and message text, then send the message to Receiver . Then the message appears in receiver message area which has that receiver id. Here is my js code "use strict"; var connection = new signalR.HubConnectionBuilder().withUrl("/chathub").build(); //Disable

Signalr using Redis backplane not propagating message

别说谁变了你拦得住时间么 提交于 2021-01-29 18:45:04
问题 I have a .net 4.5 MVC app which I have recently moved over to AWS, so we need to add a backplane to our Signalr implementation. I have followed the steps outlined at https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis. I have installed the nuget package and my current configuration looks like this: [assembly: OwinStartup(typeof(SignalrBootstrapper))] namespace app { public class SignalrBootstrapper { public void Configuration(IAppBuilder app) { var

System.ObjectDisposedException: Cannot access a disposed object, ASP.NET Core 3.1

≡放荡痞女 提交于 2021-01-29 18:09:22
问题 I am writing an API using SignalR in ASP.NET Core 3.1. I am totally new to .NET Core, and am pretty new to SignalR too. I am having an issue executing MongoDB (Atlas) queries which are running in transactions. It appears that the transaction sessions are expiring before the queries are executing. I'm quite sure it's a async / await issue, but don't seem to be able to fix it. My Hub method looks like this: public async Task<bool> UpdateProfile(object profileDto) { try { ProfileDTO profile = (

How to pass logger into SignalR hub on server side in ASP.NET Core application

怎甘沉沦 提交于 2021-01-29 11:37:27
问题 I have ASP.NET Core application with React client. I have SignalR messaging between server and client. I have the following code on server side: Startup.cs ... public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseSignalR(routes => { routes.MapHub<ChatHub>("/signalr"); }); } ... Question: Could I pass logger to ChatHub from Startup.cs as I do it with another services like this: Startup.cs private readonly ILogger _log; public Startup(IHostingEnvironment env, ILogger

How can I send the messages to specific user using user's id which stored in Mssql database?

荒凉一梦 提交于 2021-01-29 11:13:34
问题 I want to implement private chat system with Mssql Database.I want to one to one chat system. One user enter the receiver id which stored in database and message text, then send the message to Receiver . Then the message appears in receiver message area which has that receiver id. In my code works like this; Signalr produce connection id but this id changes every refresh, I want to constant id. How can I do This? This is my js code "use strict"; $(document).ready(() => { var connection = new

SignalR hub Authorize attribute doesn't work

守給你的承諾、 提交于 2021-01-29 07:25:53
问题 I'm using SignalR to send notification to angular. But i want to make it user specific. The user is logged in with azure ad. And i have a [Authorize] on the hub but the authorisation fails. But in my controller it works fine. What i have tried so far. I tried this services.AddAuthentication from the microsoft site. https://docs.microsoft.com/en-us/aspnet/core/signalr/authn-and-authz?view=aspnetcore-2.2 But then my controller can't verify the token because the token isn't in the url but in the