mitmproxy/examples/complex/nonblocking.py

13 lines
396 B
Python
Raw Normal View History

import time
2016-10-27 19:55:24 +00:00
from mitmproxy.script import concurrent
from mitmproxy import ctx
2014-09-08 14:02:31 +00:00
@concurrent # Remove this and see what happens
2016-07-08 01:37:33 +00:00
def request(flow):
2016-10-27 19:55:24 +00:00
# You don't want to use mitmproxy.ctx from a different thread
ctx.log.info("handle request: %s%s" % (flow.request.host, flow.request.path))
time.sleep(5)
ctx.log.info("start request: %s%s" % (flow.request.host, flow.request.path))