proxy authentication: how to hide password

vtail vtail at yandex.ru
Fri Jan 25 04:09:04 EST 2002


Hi, Python community.

I'm using Python 2.2 on Win2k. We have a firewall in our organization,
so I need to connect to the Internet via proxy from my .py scripts.

So I use the following lines:

proxy=urllib2.ProxyHandler({'http':'http://login:passwd@10.10.10.11:80'})
opener=urllib2.build_opener(proxy)
urllib2.install_opener(opener)
 
f = urllib2.urlopen(url-to-retrieve)

where login and passwd are my Windows login and password.

Everything works OK, but obviously there are some problems:
- my password is stored in my script as a simple text;
- I need to change my scripts regularly to correct the password;
- my colleagues can't use the same script - they should change the
login and password their.

My IT department says it possible to use WinSock without necessity to
provide any authorizations but it's not clear for us how.

Does anybody have any idea?



More information about the Python-list mailing list