title: .net HTTP_X_FORWARDED_FOR NULL on localhost
body: <p>Apologises if this has been answered else where, I could not find it. </p>
  
  <p>In the case it has not, I am trying to find the original IP of a machine who has accessed the site. </p>
  
  <p>In my basic understanding, the variable <code>HTTP_X_FORWARDED_FOR</code> will display the user's IP regardless of proxy's and other filters. if this is true, I am trying to code this but I get a null string </p>
  
  <pre><code>System.Web.HttpContext context = System.Web.HttpContext.Current;
  string ipAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; 
  </code></pre>
  
  <p>Possible problems are <code>HTTP_X_FORWARDED_FOR</code> doesn't appear in the HTTP HEADERS / server variable list, or I am using localhost? Using <code>REMOTE_ADDR</code>, the localhost IP is displayed.  </p>
  
  <p>Am I on the right lines or is my understanding incorrect?</p>
  
  <p>Thanks</p>