扭曲代理随机重定向

2024-03-29 06:05:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我在twisted中有一个非常简单的反向代理脚本:

from twisted.internet import reactor
from twisted.web import proxy, server
from twisted.python import log
from twisted.names import client

site = server.Site(proxy.ReverseProxyResource('www.example.com', 80, ''.encode("utf-8")))
reactor.listenTCP(80, site)
reactor.run()

但有时当我连接到服务器时,它会重定向到像test0.com这样的随机网站,有时还会重定向到声称我感染了病毒的网站。我想知道Twisted里有没有窃听器?或者如果有人曾经经历过?你知道吗


Tags: fromimport脚本comlogweb代理server