[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2015-09-06 Thread Thomas Belhalfaoui

Thomas Belhalfaoui added the comment:

Martin, I went through your patch and made some simple tests, and I have a 
couple of questions.

1) When I run the following code, I get a "Bad file descriptor" :

conn = httplib.HTTPConnection("uk.proxymesh.com", 31280)
conn.set_tunnel("www.google.com", 80)
conn.request("GET", "/")
resp = conn.getresponse()
print(resp.read())

So I tweaked the "getresponse" function so that it does not call "self.close()" 
(i.e. the connection stays open after the CONNECT request) in that case, and it 
seems to works fine.

2) I added "self.sock, _ = tunnel" in HTTPConnection constructor, to try your 
use case, but I get "http.client.RemoteDisconnected: Remote end closed 
connection without response".

Do you think it makes sense or am I missing something ?

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24964>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2015-09-05 Thread Thomas Belhalfaoui

Thomas Belhalfaoui added the comment:

Terry: Thanks for the form, I just filled it.

Martin: Thanks for sending your patch. I will dive into it, and try to figure 
out how to add support for passing in the tunnel details to the HTTPSConnection 
constructor.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24964>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com