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

Get remote IP for current connection #487

Closed
leonard-thieu opened this issue Nov 10, 2017 · 4 comments · Fixed by #704 or #848
Closed

Get remote IP for current connection #487

leonard-thieu opened this issue Nov 10, 2017 · 4 comments · Fixed by #704 or #848

Comments

@leonard-thieu
Copy link
Contributor

leonard-thieu commented Nov 10, 2017

I'd like to report the remote IP for telemetry purposes. I'm connecting through TCP. Is it possible to get the remote IP for the current connection? From looking through the code, it doesn't appear to be publicly exposed.

@yaakov-h
Copy link
Member

Not currently.

In theory we could expose this for TCP and UDP connections, but for WebSocket we actually don't know what IP we're connected to - name resolution is handled internally through WinHTTP on Windows, and is similarly done through the CoreFX implementations on .NET Core Linux/macOS.

@leonard-thieu
Copy link
Contributor Author

Okay, so if I wanted to expose this in my own fork, I just need to expose CurrentEndPoint on

IConnection connection;

and expose
through CurrentEndPoint.

Does that sound about right?

@yaakov-h
Copy link
Member

Sounds about right.

The second part should have already been done here...

@xPaw
Copy link
Member

xPaw commented Nov 2, 2019

This issue was closed incorrectly, #704 added PublicIP which is not the same thing as the remote ip of the server you're connected to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants