LGTM. Ignore the comments. I only now realize that you are pulling in someone else's code, http://codereview.appspot.com/5216044/diff/1/httplib2/socks.py File httplib2/socks.py (right): http://codereview.appspot.com/5216044/diff/1/httplib2/socks.py#newcode170 httplib2/socks.py:170: if (self.__proxy[4] != None and self.__proxy[5] != None): Oh. so horrible. The self.__proxy[N] with no explanation of the parts. The if X != None. But.. This is consistent with the original style, so I guess it's the best choice. http://codereview.appspot.com/5216044/diff/1/httplib2/socks.py#newcode368 httplib2/socks.py:368: headers += ["Host: ", destaddr, "\r\n"] Can't you write headers = [... ... .. "host', ....] rather than the +=?