[Patches] [ python-Patches-515003 ] Added HTTP{,S}ProxyConnection

noreply@sourceforge.net noreply@sourceforge.net
Sat, 14 Dec 2002 18:09:36 -0800


Patches item #515003, was opened at 2002-02-08 16:39
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=515003&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 3
Submitted By: Mihai Ibanescu (misa)
Assigned to: Jeremy Hylton (jhylton)
Summary: Added HTTP{,S}ProxyConnection

Initial Comment:
This patch adds HTTP*Connection classes for proxy
connections. Authenticated proxies are also supported.

One can argue urllib2 already implements this. It does
not do HTTPS tunneling through proxies, and this is
intended to be lower-level than urllib2.

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-12-14 21:09

Message:
Logged In: YES 
user_id=33168

Isaac, I don't believe SF allows you to attach a file to
someone else's patch.  Please submit a new patch.  In the
comments for the new patch refer to this patch and indicate
if it supercedes this patch (ie, should this patch be
closed).  Also, it would be nice if you can add a comment to
this patch mentioning the new patch number.  Thanks!

----------------------------------------------------------------------

Comment By: Isaac Salsberg (isalsberg)
Date: 2002-12-14 19:52

Message:
Logged In: YES 
user_id=663978

To make this patch work with the "buggy"  IIS using python 
2.2 or 2.2.1 with https, You need to install also these 2 
patches:

551273 (fix httplib bug with 100 Continue) and
500311 (work around for buggy https servers)

Python 2.2.2 by the other hand, has already incorparated 
those two patches, so You only need to add the HTTP{S} 
(515003) proxy patch. But since httplib has changed,  Misa's 
diff file will fail.

I have created a diff file that works with python 2.2.2, which 
also includes a new example that works using a certificate  
file in PEM format. I wanted to attach the file, however
I could not find out how :-(

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2002-11-05 15:56

Message:
Logged In: YES 
user_id=205865

I am having problems with proxying and keepalive
connections. Setting to a lower priority until I figure out
the documentation.

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2002-10-07 17:20

Message:
Logged In: YES 
user_id=205865

Boy, two months. Yes, I'll go back to working on the patch.
Sorry for the delay.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-10-07 17:17

Message:
Logged In: YES 
user_id=21627

misa, is a patch forthcoming?

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2002-07-15 17:37

Message:
Logged In: YES 
user_id=205865

- I agree about the comments. I'll make them reasonable.
- one underscore is fine
- I intended to have a patch that works with python 1.5, but
then again the module itself doesn't run with 1.5 anyway, so
good point.
- When you make a connection to a server through a proxy,
you have to connect to the proxy, but everything else should
be the same, i.e. the Host: field has to refer to the server
and so on. I wanted to reuse the code from _set_hostport,
which saves the host and port in self.host, self.port. Had
to do it twice, once for the proxy hostname, once for the
server's. _set_hostport takes care of the default port and
of the "hostname:port" syntax, which is convenient.

I'll put together a patched patch and upload it.


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-07-15 17:21

Message:
Logged In: YES 
user_id=31392

The proposed classes seem useful enough, but I would like to
make several suggestions for the implementation.

- There are too many comments.  Comments should only be
added when 
   the intent of the code needs to be explained.  We
definitely don't need
   one comment for each line of code.  The comment in the
HTTPS proxy
   putrequest() is an example of a helpful comment.

- Just use a single underscore for private variables.

- Please use string methods instead of the string module.

- I don't understand the logic of switching the host/port
back and forth.


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-07-15 16:52

Message:
Logged In: YES 
user_id=31392

I'll take a look.


----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-07-12 11:46

Message:
Logged In: YES 
user_id=6380

Assigning to Jeremy in the hope that he can provide a review.

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2002-06-23 23:03

Message:
Logged In: YES 
user_id=205865

The newer patch is generated against the latest CVS tree,
and it provides additional documentation.

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2002-06-11 14:47

Message:
Logged In: YES 
user_id=205865

Sorry, been caught with a zillion of other things to do.
I'll try to reorganize it somehow and ask for opinions.

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-06-11 14:42

Message:
Logged In: YES 
user_id=31392

misa-- any progress on this patch?


----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-01 18:12

Message:
Logged In: YES 
user_id=6380

OK, thanks; I'll wait!

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2002-03-01 17:58

Message:
Logged In: YES 
user_id=205865

I will add documentation and show the intended usage.
urllib* doesn't deal with proxying over SSL (using CONNECT
instead of GET/POST). urllib* also use the compatibility
classes, HTTP/HTTPS, instead of HTTPConnection (this is not
an argument by itself).
Thanks for the suggestion.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-01 17:40

Message:
Logged In: YES 
user_id=6380

This patch fails to seduce me. There's no explanation why
this would be useful, or how it should be used, and no
documentation, and a hint that urllib2 already does this.

Maybe you can get someone who's known on python-dev to
champion it, if you think it's useful?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=515003&group_id=5470