I have a critical line of code on my site that worked in our development environment, but not in production. Well, I say that it worked in development, but the truth is that it gave ::1 , which is the IPv6 loop address.
In any case, what I wanted to do was capture the IP address of the user who came to the site. So I used Request.UserHostAddress for this. As it developed, as I said, he gave me a loopback address, which is correct, since I started the site from my machine. On the living it did something completely different. It always returned the load balancing address.
What I'm trying to understand is this. Was I wrong to use Request.UserHostAddress to grab the user's IP address or something was wrong with our network setup or something else?
Thanks,
Sechin
source share