While debugging in Visual Studio which is running at following URL http://localhost:39452/
I am getting http://127.0.0.1 as the value for following property
HttpContext.Current.Request.Url
instead of http://localhost:39452/
I am having this value in my hosts file:
::1 localhost
Can you let me what I am doing wrong here?
Perhaps you are trying to get the HttpContext.Current.Request.Url value too early.
For example; during the Init event of a HttpModule you may face with these kind of problems. I mean you may get http://127.0.0.1/myApp instead of the correct value of http://localhost/myApp.
Both are localhost; ::1 is the shorthand notation of the IPv6 version and 127.0.0.1 is the IPv4 version.
I guess your assumption that you are doing something wrong, is the only thing you're doing wrong! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With