diff options
Diffstat (limited to 'examples/nonblocking.py')
-rw-r--r-- | examples/nonblocking.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/nonblocking.py b/examples/nonblocking.py new file mode 100644 index 00000000..41674b2a --- /dev/null +++ b/examples/nonblocking.py @@ -0,0 +1,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)) |