diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-07-08 20:11:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-08 20:11:12 -0700 |
commit | 15c10d49f6b020c5b913ae5b5e8c4b923a507a47 (patch) | |
tree | b13eb4f3ec88fa90b515edcf4323363124dcd995 /examples/nonblocking.py | |
parent | f7639e077ab10dc8e7f180f44b531b9ad35c060b (diff) | |
parent | 5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2 (diff) | |
download | mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.tar.gz mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.tar.bz2 mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.zip |
Merge pull request #1327 from mitmproxy/remove-script-context
Remove script context
Diffstat (limited to 'examples/nonblocking.py')
-rw-r--r-- | examples/nonblocking.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/nonblocking.py b/examples/nonblocking.py index 4609f389..b81478df 100644 --- a/examples/nonblocking.py +++ b/examples/nonblocking.py @@ -1,9 +1,10 @@ import time +import mitmproxy from mitmproxy.script import concurrent @concurrent # Remove this and see what happens -def request(context, flow): - context.log("handle request: %s%s" % (flow.request.host, flow.request.path)) +def request(flow): + mitmproxy.ctx.log("handle request: %s%s" % (flow.request.host, flow.request.path)) time.sleep(5) - context.log("start request: %s%s" % (flow.request.host, flow.request.path)) + mitmproxy.ctx.log("start request: %s%s" % (flow.request.host, flow.request.path)) |