I have the following code to download a URL through a proxy:
proxy_handler = urllib2.ProxyHandler({'http': p})
opener = urllib2.build_opener(proxy_handler)
urllib2.install_opener(opener)
req = urllib2.Request(url)
sock = urllib2.urlopen(req)
How can I use Python to determine the type of proxy server (transparent, anonymous, etc.)? One solution would be to use an external server, but I want to avoid a possible dependency, if possible.
source
share