signalr

SignalR call from controller

心已入冬 提交于 2021-01-28 07:51:14
问题 I'm needing to pass strings from my controller to a signalR hub and have it render on my page. I've followed along with the chat tutorial found at: https://docs.microsoft.com/en-us/aspnet/core/tutorials/signalr?view=aspnetcore-2.2&tabs=visual-studio The next step from the chat tutorial is breaking it out message call to my controller like so: [HttpPost] public async Task<IActionResult> Upload(string engineType) { try { var message = "File Upload Failed"; await _errorHub.Clients.All.SendAsync(

Add headers to @aspnet/signalr Javascript client

天大地大妈咪最大 提交于 2021-01-27 21:02:46
问题 I'm using @aspnet/signalr Official Javascript client from This npm package I wondering if there is the way to add Header configuration to the client connection header How I build the connection let connection = new signalR.HubConnectionBuilder() .withUrl( "https://some.signalr-host.com" ) .build(); 回答1: Update after doing some research Seems like signalR js/ts client library doesn't support adding customize headers in anyways So, our solution is sending parameters through query string instead

Ocelot not passing websockets to microservice

浪子不回头ぞ 提交于 2021-01-27 21:02:36
问题 I'm trying to connect to SignalR hubs using Ocelot as proxy. SignalR is plugged in microservice that gateway passing through websockets traffic. Negotation via HTTP request is executed successfully, but further communication via websockets seems to be lost. I don't have an idea what is going on, especially that communication with the same configuration works perfectly when Azure SignalR on another environment is used. Below I present my configuration for gateway: ocelot.json {

How to Inject dependencies in a Unity IoC container for SignalR hub?

折月煮酒 提交于 2021-01-27 14:41:55
问题 I have an application that is written with c# on the top of the ASP.NET MVC 5 Framework. I implemented Unity.Mvc into my project. Now, I am trying to inject dependencies objects into my SignalR Hub. I created a class called UnityHubActivator My class looks like this public class UnityHubActivator : IHubActivator { private readonly IUnityContainer _container; public UnityHubActivator(IUnityContainer container) { _container = container; } public IHub Create(HubDescriptor descriptor) { return

ASP.NET Core SignalR websocket connection limit

*爱你&永不变心* 提交于 2021-01-27 13:52:44
问题 I produce load testing of SignalR (ASP.NET Core) application hosted at Windows Server 2016 standard using Microsoft.AspNetCore.SignalR.Client. Dotnet core hosting 2.1.1 installed And i can not create more than 3000 (2950-3050) connections. Already tried recomendations as described here: How to configure concurrency in .NET Core Web API? Limiting performance factors of WebSocket in ASP.NET 4.5? Set limit concurrent connections for websocket on iis 8 Added limits to UseKestrel (this seems to

Blazor with AzureAD Auth, Context.Identity.User.Name is null

丶灬走出姿态 提交于 2021-01-27 12:59:56
问题 Only authenticated users can access the application as expected. I need to be able to track users via signalr. For example, if I run a ChatHub type of service, I'd like people to be able to chat using their AzureAD username which should be set automatically and not let people set their own usernames. The hub always shows Context.Identity.User.Name is null. services.AddAuthentication(AzureADDefaults.AuthenticationScheme) .AddAzureAD(options => Configuration.Bind("AzureAd", options)); services

how can I send message to specific user in specific group using asp.net signalR

淺唱寂寞╮ 提交于 2021-01-24 09:30:51
问题 I can send message to all group in chat return context.Clients.Group(sGrp).recieveNotification(message, user, chatid, uuid); I can send message to all group in chat return context.Clients.User(currentuser).seenyou(myname); the problem when i send message to specific user in specific group is there is way to do this . 回答1: The only way to send a message to a specific user is by addressing the user by its connection Id. In this case it doesn't matter if he is in a specific group or not. Other

SignalR using IdentityServer bearer won't receive any JWTBearerEvents from Hub

喜你入骨 提交于 2021-01-21 10:18:45
问题 We have an api (.net core 2.2) which use IdentityServerAuthenticationDefaults.AuthenticationScheme for all the controllers which works fine. We now decide to add SignalR Hub for a conference service. The hub is working fine only if we remove the authorize attribute [Authorize(AuthenticationSchemes = IdentityServerAuthenticationDefaults.AuthenticationScheme)] We did try to handle the token in the query using the following both methods (TokenRetriever or JwrBearerEvents) : services

SignalR using IdentityServer bearer won't receive any JWTBearerEvents from Hub

人盡茶涼 提交于 2021-01-21 10:18:15
问题 We have an api (.net core 2.2) which use IdentityServerAuthenticationDefaults.AuthenticationScheme for all the controllers which works fine. We now decide to add SignalR Hub for a conference service. The hub is working fine only if we remove the authorize attribute [Authorize(AuthenticationSchemes = IdentityServerAuthenticationDefaults.AuthenticationScheme)] We did try to handle the token in the query using the following both methods (TokenRetriever or JwrBearerEvents) : services

How do I update multiple users on Blazor Server-Side?

只愿长相守 提交于 2021-01-20 20:32:13
问题 Suppose I want a UI where users in a group have a synchronized view. Imagine a group-chat application, where everyone in the group should see the exact same messages. When a user posts a message to the group, the entire group needs to receive it. With JS, I might use SignalR Groups, and have the front-end generate a SignalR event with a message is posted. The server-side hub would then send that message out to the group. On Server-Side Blazor, since all the users' states are already on the