This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Or.Wilder
Recipients Or.Wilder
Date 2011-07-03.15:16:11
SpamBayes Score 0.0022518435
Marked as misclassified No
Message-id <1309706172.79.0.961224445373.issue12480@psf.upfronthosting.co.za>
In-reply-to
Content
I have fieddler2 listening on 0.0.0.0:8888.

this code is suppose to use the proxy on my localhost.

try:
    data = '' 
    proxy = urllib2.ProxyHandler({'http': '127.0.0.1:8888'})  //also tried {'http': 'http://127.0.0.1:8888/'}
    opener = urllib2.build_opener(proxy)
    urllib2.install_opener(opener)
    req = urllib2.Request('http://www.google.com')
    response = urllib2.urlopen(req)
    the_page = response.read()
        print the_page
except Exception, detail:
    print "Err ", detail


	

I have fieddler2 listening on 0.0.0.0:8888.

try:
    proxy = urllib2.ProxyHandler({'http': '127.0.0.1:8888'})  //also tried {'http': 'http://127.0.0.1:8888/'}
    opener = urllib2.build_opener(proxy)
    urllib2.install_opener(opener)
    req = urllib2.Request('http://www.google.com')
    response = urllib2.urlopen(req)
    the_page = response.read()
        print the_page
except Exception, detail:
    print "Err ", detail

I don't see the GET or any request to google in fieddler (but I can see other requests) is there a way to debug it? is seems like python bypasses fieddler or ignores the proxy.

the code is working, but it's not using the proxy to fetch google, it bypasses the proxy.

I also configured win7 to work with fieddler -

C:\Windows\system32>netsh winhttp set proxy 127.0.0.1:8888

Current WinHTTP proxy settings:

    Proxy Server(s) :  127.0.0.1:8888
    Bypass List     :  (none)

In order to check if the code is using the porxy I've changed fieddler to require proxy authentication and I had to use a user\pass on my browser when browsing, run the python code again and it worked, so it defiantly doesn't use the proxy.
History
Date User Action Args
2011-07-03 15:16:12Or.Wildersetrecipients: + Or.Wilder
2011-07-03 15:16:12Or.Wildersetmessageid: <1309706172.79.0.961224445373.issue12480@psf.upfronthosting.co.za>
2011-07-03 15:16:12Or.Wilderlinkissue12480 messages
2011-07-03 15:16:11Or.Wildercreate