目录
官网:https://docs.mitmproxy.org/stable/
参考文章:https://www.cnblogs.com/grandlulu/p/9525417.html
插件
import mitmproxy.http
from mitmproxy import ctx
class Counter1:
def __init__(self):
self.num = 0
def request(self, flow: mitmproxy.http.HTTPFlow):
self.num = self.num + 1
ctx.log.info("We've seen %d flows" % self.num)
class Counter2:
def __init__(self):
self.num = 0
def request(self, flow: mitmproxy.http.HTTPFlow):
self.num = self.num + 1
ctx.log.info("We've seen %d flows" % self.num)
addons = [
Counter1(),
Counter2()
]
通过对类方法实例化在运行插件的时候