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


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