Autodiscovery of proxy settings from a python script

Robin Becker robin at jessikat.fsnet.co.uk
Fri Mar 8 17:46:46 EST 2002


In article <WN9i8.355$%k6.2701351 at news-text.cableinet.net>, Andy
Robinson <andy at reportlab.com> writes
>Thanks to several people.  I am once again stunned by how
>good the Python standard library is.  I spent an afternoon
>surfing and assumed I'd have to write code, but urllib does
>most of what I want by default :-)
>
>Idiot's guide to proxy discovery and use:
>
>1. if hacking at home, get a working proxy server.  I found this
>which compiled fine and "sort of" works - dislikes GIFs
>but can receive plain pages:
>  http://www.codeguru.com/internet/http_proxy.shtml
>
>
>2.  Thereafter, set the proxy in IE and you can do this:
>>>> urllib.getproxies()
>{'ftp': 'ftp://matterhorn:5060', 'http': 'http://matterhorn:5060'}
>>>>
>
>3. Thereafter, calls to urllib.urlopen(myURL) seem to go through
>the proxy by default.
>
>- Andy
....
IE also uses this wpad scheme, but I'm not sure if that also affects the
registry settings.
-- 
Robin Becker



More information about the Python-list mailing list