title: ASP.NET Core: How to get remote IP address?
body: <p>I try to get remote (client) IP addres:</p>
  
  <pre><code>var ip = httpContext.Features.Get&lt;IHttpConnectionFeature&gt;()?.RemoteIpAddress
  </code></pre>
  
  <p>But it works only for local requests (it will return <code>::1</code> value)</p>
  
  <p>When I load page from remote machine the value is null. I investigated there is no <code>IHttpConnectionFeature</code> in the <code>Features</code> collection in this case.</p>
  
  <p>Why? And how to get remote ip address correctly?</p>