Comment 31 for bug 186920

Revision history for this message
Wesley J. Landaker (wjl) wrote : Re: bzr launchpad does not handle proxy when used for name resolution

As far as xmlrpclib not supporting proxies, this is not really true. See http://docs.python.org/library/xmlrpclib.html which gives an example of how to use a proxy. (Also pasted below for reference, but it's formatting will probably look weird here.)

"""
To access an XML-RPC server through a proxy, you need to define a custom transport. The following example shows how:

import xmlrpclib, httplib

class ProxiedTransport(xmlrpclib.Transport):
    def set_proxy(self, proxy):
        self.proxy = proxy
    def make_connection(self, host):
        self.realhost = host
        h = httplib.HTTP(self.proxy)
        return h
    def send_request(self, connection, handler, request_body):
        connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
    def send_host(self, connection, host):
        connection.putheader('Host', self.realhost)

p = ProxiedTransport()
p.set_proxy('proxy-server:8080')
server = xmlrpclib.Server('http://time.xmlrpc.com/RPC2', transport=p)
print server.currentTime.getCurrentTime()
"""