title: Force port 80 address source on Python Requests module
body: <p>The problem I have is that I am in a server  in which I have no access to the firewall. I'm using <code>requests</code> module inside a <code>celery</code> task. </p>
  
  <p>I need to get a set of images from another server. This server is listening on the <code>port 8080</code>. So, if I try to get the image by doing this:</p>
  
  <pre><code>requests.get('http://SERVERIP:8080/blabla/img.jpg', stream=True)
  </code></pre>
  
  <p>I get this error: </p>
  
  <pre><code>HTTPConnectionPool(host='SERVERIP', port=8080): Max retries exceeded with url:
  /blabla/img.jpg (Caused by &lt;class 'socket.error'&gt;: [Errno 110] Connection timed out)
  </code></pre>
  
  <p>But if try to get an image from another source like:</p>
  
  <pre><code>requests.get('http://OTHERSERVERIP/blabla/img.jpg', stream=True)
  </code></pre>
  
  <p>Is not a problem of the server that has the image, because I've tried from other servers and it works. The problem (I am almost sure), is that the requests library is trying to get the image using the port from the url (8080) as the address source. If the port is not explicit in the remote host url requests use the port 80 for both the address source and the remote host, and everything works OK. </p>
  
  <p>Any ideas on how can I force the library to use the por 80 on all cases (on the address source, meaning the outgoing connection, the port the server that made the request uses to listen )?</p>
  
  <p>As Kroolik's comment says: The OP wants to bind a tcp socket to port 80 on localhost, and send http requests to the other server using that socket </p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>After all the comments I've read, I think I am maybe not understanding the problem. The most basic scenario is that if try to access any URL that is listening on a port different than 80 or 443 I get the error and I need to connect to a URL of an app that is listening on the port 8080. At this moment I've solved the problem changing some stuff on the other server, but I would really like to understand what the problema was here! Thanks! </p>