--
The website for the club is http://stab-iitb.org/wncc
To post to this group, send email to wncc...@googlegroups.com
Chhatoi Pritam Baral
I have tried both env variables and urllib proxy function.... former
one appears to be connecting faster....
On 1/27/12, Pritam Baral <pri...@pritambaral.co.cc> wrote:
> 407 is when the Proxy Authentication went wrong. Here, it means urllib2
> guessed the proxy correctly (from the environment variables, if not IE),
> but not the LDAP ID and password, or the password wasn't urlencoded. A more
> complete solution would be:
>
> import urllib2
> from urllib import quote
> ldap_ip = quote('<LDAP_ID>')
> ldap_password = quote('<LDAP_PASSWORD>')
> proxy = urllib2.ProxyHandler({'http':
> ldap_id+':'+ldap_password+'@netmon.iitb.ac.in:80'})
> opener = urllib2.build_opener(proxy)
> urllib2.install_opener(opener)
> print urllib2.urlopen('http://www.google.com').read()
>
> PS: The way urllib *guesses* the Proxy settings: environment variabes. So I
> guess changing the environment variable in the python script itself would
> also do. If not http_proxy (or https_proxy) env values are set, only then
> does it look into the Windows Registry.
>
> PSS: How come you uninstalled IE, I don't think Windows let's one do that.
>
> *Regards,*
>
> *Chhatoi Pritam Baral*
>>> *
>>>
>>>
>>> Aliabbas Petiwala| Phd Scholar|Interdisciplinary Program in Education
>>> Technology**|IIT *
>>> **
>>> **
>>> *Bombay|+919664867707 | http://home.iitb.ac.in/~aliabbas/*
>>>
>>>
>>> --
>>> The website for the club is http://stab-iitb.org/wncc
>>> To post to this group, send email to wncc...@googlegroups.com
>>>
>>
>> --
>> The website for the club is http://stab-iitb.org/wncc
>> To post to this group, send email to wncc...@googlegroups.com
>>
>
> --
> The website for the club is http://stab-iitb.org/wncc
> To post to this group, send email to wncc...@googlegroups.com
>
--
Regards,
Amol Mandhane | Co-ordinator | Web n' Coding Club
IIT Bombay
Set the environment variables..... its the best thing to do in this case...
I have tried both env variables and urllib proxy function.... former
one appears to be connecting faster....