Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Request.UserHostAddress reliable?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01418265
Message ID:
01419044
Vues:
52
>Hi,
>
>I need to log IP of the user who is using my ASP.NET application (access is anonymous). I found (by Googling) the call to Request.UserHostAddress as a way to get the IP. It works on my notebook where I see "127.0.0.1". How reliable this approach is when the user will be accessing the application on real Intranet or Internet?
>
>Thank you in advance for your help.

It works fine. The only "issue" is that if the people are behind a NAT firewall you will see the address of the firewall, not the user. For example, my IP address is 192.168.1.100 and I hit a website. The website will see the address of our firewall which is 12.*.*.* (not the 192.*.*.* address). All users behind that firewall will appear to come from the same addres. I say "issue" because some people mistake this for a problem when it's exactly the correct behavior.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform