Author thomas.belhalfaoui
Recipients thomas.belhalfaoui
Date 2015-08-30.17:41:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When using httplib / http.client to connect to an HTTPS website through a proxy (by making a tunnel with a CONNECT request), there is no way to retrieve the HTTP headers which the proxy sends back in response to that CONNECT request.

This becomes a problem when using rotating proxy providers like ProxyMesh, who send useful information in those headers (for instance, "X-ProxyMesh-IP" contains the IP address of the proxy, which is necessary to keep the same address throughout the session).

It would be nice to save those headers in a property of the HTTPConnection class (e.g. self._tunnel_response_headers), which would be set up inside the _tunnel method (as proposed in the attached patch, lines 748 and 827-831). This would allow to get the headers back and/or pass them to a higher-level library (such as requests).
Date User Action Args
2015-08-30 17:41:56thomas.belhalfaouisetrecipients: + thomas.belhalfaoui
2015-08-30 17:41:50thomas.belhalfaouisetmessageid: <>
2015-08-30 17:41:50thomas.belhalfaouilinkissue24964 messages
2015-08-30 17:41:49thomas.belhalfaouicreate