title: How do I get the IP address from a http request using the requests library?
body: <p>I am making HTTP requests using the requests library in python, but I need the IP address from the server that responded to the HTTP request and I'm trying to avoid making two calls (and possibly having a different IP address from the one that responded to the request).</p>
  <p>Is that possible? Does any python HTTP library allow me to do that?</p>
  <p>PS: I also need to make HTTPS requests and use an authenticated proxy.</p>
  <p><strong>Update 1:</strong></p>
  <p>Example:</p>
  <pre><code>import requests
  
  proxies = {
    &quot;http&quot;: &quot;http://user:password@10.10.1.10:3128&quot;,
    &quot;https&quot;: &quot;http://user:password@10.10.1.10:1080&quot;,
  }
  
  response = requests.get(&quot;http://example.org&quot;, proxies=proxies)
  response.ip # This doesn't exist, this is just an what I would like to do
  </code></pre>
  <p>Then, I would like to know to which IP address requests are connected from a method or property in the response. In other libraries, I was able to do that by finding the sock object and using the <code>getpeername()</code> function.</p>