[Patches] [ python-Patches-515003 ] Added HTTP{,S}ProxyConnection
SourceForge.net
noreply at sourceforge.net
Fri Oct 31 19:25:08 EST 2003
Patches item #515003, was opened at 2002-02-08 13:39
Message generated for change (Comment added) made by gstein
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: Martin v. Löwis (loewis)
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: Greg Stein (gstein)
Date: 2003-10-31 16:25
Message:
Logged In: YES
user_id=6501
Eek. Following this model, then when we want to add Basic
authentication support, then we'll have the following classes:
HTTPBasicConnection
HTTPSBasicConnection
HTTPBasicProxyConnection
HTTPSBasicProxyConnection
Oh, and what if we want Digest support? Another set of four?
But what if we want the connection to support *both* Basic
or Digest, depending upon how the server was configured?
Let's not forget the client certificates. Oh, and layering
DAV capability on this.
The point is: adding features by adding classes will produce
a combinatoric nightmare. While I certainly agree with the
idea of pushing proxy support "down" from urllib(2) into the
basic http classes, I'd rather see a design that doesn't
require a new class for every feature combination.
PEP 268 was the start of an attempt to rationalize the
various features around HTTP. Some of the basic feature sets
to support:
* SSL
* various forms of authentication (Basic, Digest, client
cert, ...)
* WebDAV
* Proxy
* Proxy auth
I'd much rather see proxy features folded right into the
connection classes, than to spawn new ones. Even better, I'd
suggest picking up PEP 268 and modifying it where "you"
(whoever might read this comment) disagree or have further
design ideas.
(IOW, count me a -1 to the approach suggested by this patch)
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-10 17:15
Message:
Logged In: YES
user_id=33168
Uploading patch from Isaac Salsberg. I removed some more
comments. Jeremy (or Martin) can you review this. If it's
read, I can check it in.
There still needs to be a doc and tests. I'll check if
either of the old patches has any.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-01 11:52
Message:
Logged In: YES
user_id=33168
Isaac, can you send me the patch? nnorwitz at users.sf.net
should work
----------------------------------------------------------------------
Comment By: Isaac Salsberg (isalsberg)
Date: 2002-12-19 17:54
Message:
Logged In: YES
user_id=663978
Neal, taht's right, I can not attach a file.
I don't think is a good idea to close this patch, because
Misa is still working on it to fix some persistence issue.
The version I created is based on the current Misa's
version, so it has the same persistence problem. It just
was adapted to be used with Python 2.2.2. So we need to
wait for Misa's final version.
I sent the patch to Misa, in case he wants to atach it here
meanwhile the last version arrives. Except for persistence,
It is working for me in a production environment.
Anyway, If You need the patch I can send it. Just give me
an email address.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2002-12-14 18: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 16: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 12: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 14: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 14:17
Message:
Logged In: YES
user_id=21627
misa, is a patch forthcoming?
----------------------------------------------------------------------
Comment By: Mihai Ibanescu (misa)
Date: 2002-07-15 14: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 14: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 13:52
Message:
Logged In: YES
user_id=31392
I'll take a look.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-07-12 08: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 20: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 11: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 11:42
Message:
Logged In: YES
user_id=31392
misa-- any progress on this patch?
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-01 15:12
Message:
Logged In: YES
user_id=6380
OK, thanks; I'll wait!
----------------------------------------------------------------------
Comment By: Mihai Ibanescu (misa)
Date: 2002-03-01 14: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 14: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
More information about the Patches
mailing list