Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Web page how to obtain a visitor IP #4494

Closed
Seanxwy opened this issue Apr 17, 2016 · 15 comments
Closed

Web page how to obtain a visitor IP #4494

Seanxwy opened this issue Apr 17, 2016 · 15 comments

Comments

@Seanxwy
Copy link

Seanxwy commented Apr 17, 2016

Web page how to obtain a visitor IP
in asp.net core rc1

@Muchiachio
Copy link
Contributor

public IActionResult Index()
{
    return View(HttpContext.Connection.RemoteIpAddress);
}

@cwe1ss
Copy link
Contributor

cwe1ss commented Apr 18, 2016

I think this does not work in RC1 if you use Kestrel as this was not yet implemented there. It is fixed in RC2.

@Seanxwy
Copy link
Author

Seanxwy commented Apr 18, 2016

@Muchiachio rc1 not have this methods.

@Seanxwy
Copy link
Author

Seanxwy commented Apr 18, 2016

@cwe1ss rc2 release time is ?????

@cwe1ss
Copy link
Contributor

cwe1ss commented Apr 18, 2016

there is no release date yet. the weekly standups on https://live.asp.net are your best source for updates.

@Seanxwy
Copy link
Author

Seanxwy commented Apr 18, 2016

release in 20 Apr, 2016 ?? Hope is really, RC1 there are too many defects, cannot bear to continue

@Muchiachio
Copy link
Contributor

RC1 has this method, don't know if it works or not on remote, but it returns :::1 on local as I would expect.

@Seanxwy
Copy link
Author

Seanxwy commented Apr 18, 2016

@Muchiachio Can't works on remote

@Eilon
Copy link
Member

Eilon commented Apr 18, 2016

@Tratcher any idea on this?

@Tratcher
Copy link
Member

Wait for RC2, there were lots of issues with this on RC1.
aspnet/IISIntegration#17

@Eilon
Copy link
Member

Eilon commented Apr 18, 2016

@Tratcher so as far as we know this was fixed in RC2?

@Tratcher
Copy link
Member

Yes

@Eilon
Copy link
Member

Eilon commented Apr 18, 2016

Ok then that's the answer: this is fixed in RC2. You can get the latest RC2 nightly builds from here: https://www.myget.org/gallery/aspnetrelease

@Eilon Eilon closed this as completed Apr 18, 2016
@wgutierrezr
Copy link

Hi
I'm still having HttpContext.Connection.RemoteIpAddress issues, it returns ::1

I'm using Asp.Net Core 1.1 MVC

Regards

@Tratcher
Copy link
Member

@wgutierrezr please open a new issue in BasicMiddleware, I expect you're having an issue with the forwarded headers for the remote IP. Please share the request headers as received by the server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants