Twisted: Get Protected HTTPS Page via Proxy with Authentication

Robert Hancock hancock.robert at gmail.com
Tue Sep 23 21:11:03 CEST 2008


This  works:
        # Proxy credentials
        proxyAuth = base64.encodestring('%s:%s' % (proxy_username,
proxy_password))
        proxy_authHeader = "Basic " + proxyAuth.strip()

       # Web site credentials
        basicAuth = base64.encodestring('%s:%s' % (username,
password))
        authHeader = "Basic " + basicAuth.strip()

        return client.getPage(url, headers={"Authorization":
authHeader, 'Proxy-Authenticate': proxy_authHeader})




More information about the Python-list mailing list