Reputation: 4862
i'm looking for a way to get the client ip address inside controller. I've tried HttpContext.Current.Request.UserHostAddress
. This returns me ::1
. Right now the Webserver is running on localhost and the requst is from localhost, too. Will this method work after deploying ?
Upvotes: 3
Views: 1348
Reputation: 19830
Yes it will work.Now it is returing localhost in IP 6 format.
There are only a few things you should remember about:
Upvotes: 4