こんにちは!私はこのコードを持っています:
from twisted.web import proxy, http
from twisted.internet import reactor
class akaProxy(proxy.Proxy):
"""
Local proxy = bridge between browser and web application
"""
def dataReceived(self, data):
print "Received data..."
headers = data.split("\n")
request = headers[0].split(" ")
method = request[0].lower()
action = request[1]
print action
print "ended content manipulation"
return proxy.Proxy.dataReceived(self, data)
class ProxyFactory(http.HTTPFactory):
protocol = akaProxy
def intercept(port):
print "Intercept"
try:
factory = ProxyFactory()
reactor.listenTCP(port, factory)
reactor.run()
except Exception as excp:
print str(excp)
intercept(1337)
上記のコードを使用して、ブラウザとWebサイトの間のすべてを傍受します。上記を使用する場合、ブラウザの設定をIP:127.0.0.1およびポート:1337に構成します。このスクリプトをリモートサーバーに配置して、リモートサーバーをプロキシサーバーとして機能させます。しかし、ブラウザのプロキシIP設定をサーバーに変更すると、機能しません。私は何を間違えますか?他に何を設定する必要がありますか?