Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > i have configured proxy but fiddler can't capture python's network requests

Reply
Thread Tools

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

 
 
成都七中2002级7班_大家都是天才~
Guest
Posts: n/a
 
      07-04-2011
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?
 
Reply With Quote
 
 
 
 
Chris Angelico
Guest
Posts: n/a
 
      07-04-2011
2011/7/5 成都七中2002级7班_大家都是天才~ <(E-Mail Removed)>:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HttpWebRequest & Fiddler andyscott12 ASP .Net 0 06-24-2009 03:28 AM
See webservice requests in Fiddler hvj@paralax.nl ASP .Net 0 04-29-2009 01:21 PM
No sound but ringing if configured E1 to have 30 channels MdV Cisco 10 10-18-2006 04:20 AM
The proxy settings are not configured correctly for Web discovery? Bruce W.1 ASP .Net Web Services 0 12-12-2003 01:26 AM
Proxy settings not configured for weg discovery. Dave ASP .Net Web Services 0 09-14-2003 11:16 PM



Advertisments