i have configured proxy but fiddler can't capture python's network requests

Discussion in 'Python' started by ³É¶¼ÆßÖÐ2002¼¶7°à_´ó¼Ò¶¼ÊÇÌì²Å¡«, Jul 4, 2011.

  1. here's my code. I've change the port from 8888 to 1111.

    import urllib2
    proxy_support = urllib2.ProxyHandler({'http':'http://127.0.0.1:1111'})
    opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler)
    urllib2.install_opener(opener)
    content = urllib2.urlopen('http://www.google.com').read()
    print content

    The weird thing is:
    1. If I close fiddler, python throws error when running

    Traceback (most recent call last):
    File "C:\Users\Micky\test.py", line 5, in <module>
    content = urllib2.urlopen('http://www.google.com').read()
    File "D:\Python27\lib\urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
    File "D:\Python27\lib\urllib2.py", line 394, in open
    response = self._open(req, data)
    File "D:\Python27\lib\urllib2.py", line 412, in _open
    '_open', req)
    File "D:\Python27\lib\urllib2.py", line 372, in _call_chain
    result = func(*args)
    File "D:\Python27\lib\urllib2.py", line 1199, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File "D:\Python27\lib\urllib2.py", line 1174, in do_open
    raise URLError(err)
    URLError: <urlopen error [Errno 10061] No connection could be made
    because the target machine actively refused it>

    2. If I open fiddler, everything works great. But I can't see the
    traffic in fiddler. And if I change port from 1111 to any other
    number, it works find too.

    Any clues?
     
    ³É¶¼ÆßÖÐ2002¼¶7°à_´ó¼Ò¶¼ÊÇÌì²Å¡«, Jul 4, 2011
    #1
    1. Advertising

  2. Re: i have configured proxy but fiddler can't capture python'snetwork requests

    2011/7/5 ³É¶¼ÆßÖÐ2002¼¶7°à_´ó¼Ò¶¼ÊÇÌì²Å¡« <>:
    > 2. If I open fiddler, everything works great. But I can't see the
    > traffic in fiddler. And if I change port from 1111 to any other
    > number, it works find too.
    >


    It sounds to me like the traffic's going through fiddler, but you're
    just not seeing any log entries. The reactions from the Python end are
    exactly what I'd expect. Look at fiddler's documentation to see if you
    can enable verbose logging, or something of the sort.

    Chris Angelico
     
    Chris Angelico, Jul 4, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    506
  2. andyscott12

    HttpWebRequest & Fiddler

    andyscott12, Jun 24, 2009, in forum: .NET
    Replies:
    0
    Views:
    2,373
    andyscott12
    Jun 24, 2009
  3. Klein Stéphane
    Replies:
    3
    Views:
    619
    Steve Holden
    Dec 20, 2009
  4. Dave

    Proxy settings not configured for weg discovery.

    Dave, Sep 15, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    159
  5. Bruce W.1
    Replies:
    0
    Views:
    410
    Bruce W.1
    Dec 12, 2003
Loading...

Share This Page