Monday, February 4, 2013

Real IPAddress of users



in ASP.NET ,UserHostAddress may not return the correct IPAddress of the client machine , use X-FORWARDED-FOR to getting the correct result.

FOR MORE INFO ::

http://thepcspy.com/read/getting_the_real_ip_of_your_users/

' Look for a proxy address first
Dim _ip As String = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
' If there is no proxy, get the standard remote address
If (_ip = "" Or _ip.ToLower = "unknown") Then _
_ip = Request.ServerVariables("REMOTE_ADDR")



Also ,very good info on wiki...
http://en.wikipedia.org/wiki/X-Forwarded-For

Intalling ARR in IIS 7 and higher



excellent article by wonyoo on how to do this if one doesn't want to use web platform installer (no permissions etc.issues)

http://blogs.iis.net/wonyoo/archive/2011/04/20/how-to-install-application-request-routing-arr-2-5-without-web-platform-installer-webpi.aspx

if you want to use web platform installer http://www.iis.net/downloads/microsoft/application-request-routing