mitmproxy/examples/nonblocking.py

11 lines
330 B
Python
Raw Normal View History

import time
2016-07-08 01:37:33 +00:00
import mitmproxy
from mitmproxy.script import concurrent
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-07-09 02:57:57 +00:00
mitmproxy.ctx.log("handle request: %s%s" % (flow.request.host, flow.request.path))
time.sleep(5)
2016-07-09 02:57:57 +00:00
mitmproxy.ctx.log("start request: %s%s" % (flow.request.host, flow.request.path))