launchpad proxy support

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Oct 29 21:15:18 GMT 2009


>>>>> "Gordon" == Gordon Tyler <gordon at doxxx.net> writes:


    Gordon> Gordon Tyler wrote:
    >> Gordon Tyler wrote:
    >>> I've tested this at home using tinyproxy installed on a Debian
    >>> box, with the bzr client on a Windows box. Unfortunately, in
    >>> the firewalled & proxied corp environment, it's now failing
    >>> with a 502 Proxy Error which I still have to figure out.
    >> 
    >> Interestingly, I get what looks like the same error from Git
    >> when it's configured to use the same CNTLM proxy in my work
    >> environment. This may be a bug in my proxy setup...

<snip/>

    Gordon> I've pushed this fix up to lp:~doxxx/brz/lp_proxy just now. I
    Gordon> still need to figure out how to not clobber an explicit port in
    Gordon> the XMLRPC service URL.

So a couple of general remarks: what you really want to reuse is
the HTTPConnection objects in _urllib2_wrappers.

SO forget about the http_transport file entirely (we'll need some
copyright assignments anyway so let's keep it simple too).

The idea is that you define some HTTP/HTTPS classes inside
lp_registration and override their _connection_class attributes
with the _urllib2_wrappers HTTPConection objects.  Doing that
will avoid having to redefine the request method too.

So one pair of classes for http and one for https.

Then, we will need tests, which has been the main blocking point
for me so far.... I think the simplest here is to go with some
fake server with pre-canned responses tailored to one request
where the proxied server has one response and the not proxied one
another response just to ensure we reach the good one.

We'lll have to test for the various proxies combinations too
http[s] -> http[s].

   Vincent



More information about the bazaar mailing list