有没有办法通过Fiddler的代理将用python的httplib
发出的HTTPs请求隧道化,而不将Fiddler变成反向代理?
我尝试使用这个示例(来自here):
import httplib
c = httplib.HTTPSConnection('localhost',8118)
c.set_tunnel('twitter.com',443)
c.request('GET','/')
r1 = c.getresponse()
print r1.status,r1.reason
data1 = r1.read()
print len(data1)
但它又回来了:
<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><TITLE>Fiddler Echo Service</TITLE></HEAD><BODY STYLE="font-family: arial,sans-serif;"><H1>Fiddler Echo Service</H1><BR /><PRE>GET / HTTP/1.1
Host: localhost:8080
Accept-Encoding: identity
</PRE><BR><HR><UL><LI>To configure Fiddler as a reverse proxy instead of seeing this page, see <A HREF='http://fiddler2.com/r/?REVERSEPROXY'>Reverse Proxy Setup</A><LI>You can download the <a href="FiddlerRoot.cer">FiddlerRoot certificate</A></UL></BODY></HTML>
编辑: 这个代码有效。该问题与Internet Explorer中的代理设置有关。不要在这些设置中设置代理,否则上面的代码将不起作用。
我试过通过Burp代理使用urllib2(Proxy with urllib2),它成功了:
您的代码似乎与Burp套件代理一起工作得很好。
相关问题 更多 >
编程相关推荐