I am trying to get client ip address using
HttpContext.Request.UserHostAddress;
but it returns ::1
.
How to solve
Although it's true that this is not a bug, maybe you can check this link, where your problem is nicely described and "solved". It says that the way the issue behaves depends on the operating system, since a user fixed some problems in an application running in Windows Server 2008 by commenting the ::1
line in the hosts file, while he had to uncomment it in Windows 7.
Hope you managed to solve that! Good luck!