title: Why do I always get the same IP when getting Request.UserHostAddress in WebAPI custom action filter?
body: <p>I've created a Web API custom action filter to log incoming calls. I'm trying to get the caller's IP address and everything I've found says to use <code>Request.UserHostAddress</code>. The problem is that no matter where the call is coming from, the IP is the same.</p>
  
  <p>Here's the code for my action filter:</p>
  
  <pre><code>public class LogActionFilter : ActionFilterAttribute
  {
      public override void OnActionExecuting(HttpActionContext actionContext)
      {
          var name = actionContext.ActionDescriptor.ActionName;
  
          // Get the sender address
          var caller = ((HttpContextWrapper)actionContext.Request.Properties["MS_HttpContext"]).Request.UserHostAddress;
  
          // Log the call
          SystemBL.InsertSiteLog("WebAPI:" + name, "From:" + caller);
      }
  }
  </code></pre>
  
  <p>I've also tried with:</p>
  
  <pre><code>var caller = ((HttpContextWrapper)actionContext.Request.Properties["MS_HttpContext"]).Request.ServerVariables["REMOTE_ADDR"].ToString();
  </code></pre>
  
  <p>but the result was the same. Any ideas?</p>