aboutsummaryrefslogtreecommitdiffstats
path: root/examples/nonblocking.py
blob: 4609f389a296f10cd52e938ea2d54a219b85a6a6 (plain)
1
2
3
4
5
6
7
8
9
import time
from mitmproxy.script import concurrent


@concurrent  # Remove this and see what happens
def request(context, flow):
    context.log("handle request: %s%s" % (flow.request.host, flow.request.path))
    time.sleep(5)
    context.log("start  request: %s%s" % (flow.request.host, flow.request.path))