diff options
Diffstat (limited to 'examples/complex/nonblocking.py')
-rw-r--r-- | examples/complex/nonblocking.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/complex/nonblocking.py b/examples/complex/nonblocking.py index 72c9c0ab..dd74aec0 100644 --- a/examples/complex/nonblocking.py +++ b/examples/complex/nonblocking.py @@ -1,12 +1,11 @@ import time from mitmproxy.script import concurrent -from mitmproxy import ctx @concurrent # Remove this and see what happens def request(flow): - # 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)) + # This is ugly in mitmproxy's UI, but you don't want to use mitmproxy.ctx.log from a different thread. + print("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)) + print("start request: %s%s" % (flow.request.host, flow.request.path)) |