aboutsummaryrefslogtreecommitdiffstats
path: root/examples/addons/anatomy.py
blob: c60afeaa4aad681a4dd62d90f646e24c573fba01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from mitmproxy import ctx


class Counter:
    def __init__(self):
        self.num = 0

    def request(self, flow):
        self.num = self.num + 1
        ctx.log.info("We've seen %d flows" % self.num)


addons = [
    Counter()
]