1
어떻게이 코드를 사용하여 2 개의 개별 요청을 보낼 수 있습니까? 두 번째 ...파이썬 트위스트 프록시가 2 개의 요청을 전송합니다.
GET http://yahoo.com HTTP/1.1
User-Agent: mozilla
Accept: */*
: ...
Request2 ...
HEAD http://google.com
Host: google.com
구글 서버에서 응답을 기다립니다
Request1 : 요청은 순서에있을 것입니다 첫 번째 요청이 모든 요청에 대해 정적 인 동안 브라우저에서 전송 된 요청 ...
코드 수정하려고하는 것입니다 :
from twisted.web import proxy, http
class SnifferProxy(proxy.Proxy):
def allContentReceived(self):
print "Received data..."
print "method = %s" % self._command
print "action = %s" % self._path
print "ended content manipulation\n\n"
return proxy.Proxy.allContentReceived(self)
class ProxyFactory(http.HTTPFactory):
protocol = SnifferProxy
if __name__ == "__main__":
from twisted.internet import reactor
reactor.listenTCP(8080, ProxyFactory())
reactor.run()
트위스트 프록시가 어떤 도움에 감사드립니다 다른 외부 프록시 에 연결하는 것입니다 ..
다음은 wireshark의 사진으로 어떤 임을 달성했는지 보여줍니다! [요청] [1] [1] http://imgur.com/AR3hYPj @bennomadic – mikie