Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page.Request.UserHostAddress is in an invalid format

Sometimes my ASP.NET application returns a value of "::1" when querying Page.Request.UserHostAddress.

I can't see any pattern as to when it returns a correct IP address vs when it returns the incorrectly formatted string. It will work for half a day and then stop working for an hour randomly. Any thoughts?

Edit:

Okay, it's the loopback address for IPv6. :) Which leads to the further question... When/why would IPv6 be used on some occasions and not others?

like image 847
Andy Hume Avatar asked Jun 06 '09 16:06

Andy Hume


2 Answers

::1 is the IPv6 loopback address. Equivalent to 127.0.0.1 for IPv4.

like image 138
alexn Avatar answered Sep 22 '22 01:09

alexn


That's also a correct IP address, but it's an IPv6 address instead of an IPv4 address.

like image 20
Guffa Avatar answered Sep 20 '22 01:09

Guffa