log.startLogging(sys.stdout)


class MyProxy(proxy.Proxy):

    def dataReceived(self, data):
        print(data)
return proxy.Proxy.dataReceived(self, data)


class ProxyFactory(http.HTTPFactory):
    protocol = MyProxy
factory = ProxyFactory()
reactor.listenTCP(8080, factory)
reactor.run()
Python Twisted proxy — как перехватывать пакеты