Joe Gregorio  committed 0b91b6d

When opening a socket for HTTP, httplib2 uses the IP and port that is returned from socket.getaddrinfo(, self.port, 0, socket.SOCK_STREAM). This breaks using an HTTP CONNECT proxy by preventing the socks module from ever seeing the original domain name. Using the orignal hostname and port seem to be the correct choice here as the socket library will resolve them and it would have already been cached.

  • Participants
  • Parent commits 481dc85
  • Branches default

Comments (0)

Files changed (1)

File python2/httplib2/

                 if self.debuglevel > 0:
                     print "connect: (%s, %s)" % (, self.port)
-                self.sock.connect(sa)
+                self.sock.connect((, self.port) + sa[2:])
             except socket.error, msg:
                 if self.debuglevel > 0:
                     print 'connect fail:', (, self.port)