Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I access the ConnectionContext from Blazor server-side #14167

Closed
enetstudio opened this issue Sep 19, 2019 · 6 comments
Closed

How can I access the ConnectionContext from Blazor server-side #14167

enetstudio opened this issue Sep 19, 2019 · 6 comments
Labels
area-blazor Includes: Blazor, Razor Components
Milestone

Comments

@enetstudio
Copy link

Is there a way to do that ?

Thanks....

@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Sep 19, 2019
@javiercn
Copy link
Member

@enetstudio Thanks for contacting us.

We don't pass in the connection context to Blazor Server-side applications.

What are you trying to accomplish? Why do you want to have access to the connection context?

@enetstudio
Copy link
Author

I thank you for the time you took to respond. I'd like to get client information such as IP adress and browser name/version in Blazor server-side.

I read this comment anurse:
For the IP address, you can use the GetHttpContext extension method on ConnectionContext to get an HttpContext and then use the Connection property on there to find the client information.

And this:
#944 added better support for getting Client IP data, and the rest is all available off the HttpContext via the ConnectionContext.GetHttpContext method.

Link: aspnet/SignalR#1114

But not a word about how to access ConnectionContext.

Once again, I want to get client information such as IP address and browser name/version in Blazor server-side...

Many thanks...

@mkArtakMSFT mkArtakMSFT added the Docs This issue tracks updating documentation label Sep 20, 2019
@mkArtakMSFT mkArtakMSFT added this to the 5.0.0-preview1 milestone Sep 20, 2019
@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one and removed Docs This issue tracks updating documentation labels Sep 20, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @enetstudio.
There is no a good way to do this at the moment. We will look into how we can provide make this information available to the client.

@Andrew-Pynch
Copy link

@mkArtakMSFT any updates on this? Really need this functionality in my app and would prefer to use native functionality than the weird workarounds with the Javascript interop. 😆

@javiercn
Copy link
Member

@Andrew-Pynch We recommend you follow the approach described here to pass any data you need from the request into the Blazor app

@ghost
Copy link

ghost commented Jul 23, 2020

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@javiercn javiercn removed the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jul 23, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Aug 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

5 participants