Hi guys, is there any built-in way (without make a custom Hub), to automatically store QueryString values inside OnlineClient.Properties?
Actually I'm working on a FrontEnd custom app, that use SignalR environment to get notified for a specic events. But I need to know some certain client's metadata, and I'd like to use OnlineClient builtin "Properties" property!
6 Answer(s)
-
0
no Ideas?
-
0
hi
What is product framework type (.net framework or .net core)?
You can override the
CreateClientForCurrentConnection
method to customizeOnlineClient
.https://github.com/aspnetboilerplate/aspnetboilerplate/blob/37a46288e96a12b5a5318b84fd7bd659b61dc7f4/src/Abp.AspNetCore.SignalR/AspNetCore/SignalR/Hubs/OnlineClientHubBase.cs#L59
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/e0ded5d8702f389aa1f5947d3446f16aec845287/src/Abp.Web.SignalR/Web/SignalR/Hubs/AbpCommonHub.cs#L84
-
0
Hi @mailming,
I'm on .net core version.
Thanks for your reply! What you suggest, is to make a custom Hub inherting
OnlineClientHubBase
! It is correct, but is what I don't like to do, because it constraints me to reference my own dll inside Web.Host project to map the custom hub.I'd like to maintain my customized logic inside a Plugin, and load it dynamically with ABP plugin system!
My question was if there are any automatic ways to populate OnlineClient.Properties from Querystring!
If not, I will open a feature request on GitHub, or better, make a PR with this implementation :D
-
0
We can consider adding an
IOnlineClientProvider
interface to createOnlineClient
. Just like theIClientInfoProvider
interface. https://github.com/aspnetboilerplate/aspnetboilerplate/blob/37a46288e96a12b5a5318b84fd7bd659b61dc7f4/src/Abp.AspNetCore.SignalR/AspNetCore/SignalR/Hubs/OnlineClientHubBase.cs#L71This way you can replace
provider
through dependency injection.You can open PR if you want.
-
0
I made a PR that implements a more simple way to accomplish thoose needs. Please take a look at https://github.com/aspnetboilerplate/aspnetboilerplate/pull/5613
-
0
Thanks @fabiovalerio
We can continue discussing this on the related PR.