How can I setup proxy of urllib2 properly



I got some source code form python's help document. the below:

proxy_handler = urllib2.ProxyHandler({'http':
'http://www.example.com:3128/'})
proxy_auth_handler = urllib2.HTTPBasicAuthHandler()
proxy_auth_handler.add_password('realm', 'host', 'username',
'password')
^^^^^^^ ^^^^^

opener = urllib2.build_opener(proxy_handler, proxy_auth_handler)
# This time, rather than install the OpenerDirector, we use it
directly:
opener.open('http://www.example.com/login.html')

I have only the username and password of proxy server. But I do not
know what should I provide for the 'realm' and 'host' prameters of
add_password function.

for example,
My proxy server is "www.myproxy.com"
username is "user1"
password is "pass1"

how can I provide parameters for "add_password" function?

.



Relevant Pages

  • Re: Trend CSM 3.0 will not push to XP clients
    ... "hillservices\administrator does not have administrator privileges" and If I ... The username and/or password may be invalid...." ... >> was trying to install to an XP Pro SP2 client with the Microsoft Firewall ... >> or the target computer is running Windows XP using simple file sharing. ...
    (microsoft.public.windows.server.sbs)
  • New to XP problems
    ... long time Windows user since Windows 2.x:) but have stayed with 98SE as ... printers and one acts as a general file server and a proxy server to the ... rollback drivers etc. etc. just (as usual once DX ... Install goes smoothly. ...
    (microsoft.public.windowsxp.newusers)
  • Re: Trend CSM 3.0 will not push to XP clients
    ... The username and/or password may be ... >>> and I am trying to remotely install to XP Pro SP2 clients using the ... >>> was trying to install to an XP Pro SP2 client with the Microsoft ... >>> or the target computer is running Windows XP using simple file sharing. ...
    (microsoft.public.windows.server.sbs)
  • Re: proxy server
    ... able to Connect OK to the Login Server, which if the Proxy Server ... Database/Records) is just cos you forgot what the proper one was, ... I know he has a System that has a "Hyper Threading" Processor (like ... various other people who might want to Install ...
    (uk.people.silversurfers)
  • RE: 0x8024402C is driving me absolutely crazy!
    ... install NET Framework and other non critical ones i've got this blocked up. ... Strange stuff cos i havent updated my laptop for a while so decided to try ... the Windows update! ... My server is running NT4 with Proxy Server 2.0 ...
    (microsoft.public.windowsupdate)