aboutsummaryrefslogtreecommitdiffstats
path: root/examples/nonblocking.py
blob: 41674b2a3ba1d25b620fea92f94caa9c29a47f0b (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):
    print("handle request: %s%s" % (flow.request.host, flow.request.path))
    time.sleep(5)
    print("start  request: %s%s" % (flow.request.host, flow.request.path))