1. Jason R. Coombs
  2. jaraco.httplib2


Joe Gregorio  committed 0b91b6d

When opening a socket for HTTP, httplib2 uses the IP and port that is returned from socket.getaddrinfo(self.host, 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/__init__.py

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