File: nonblocking.py

package info (click to toggle)
mitmproxy 0.18.2-6%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 37,444 kB
  • sloc: python: 33,213; makefile: 167; ansic: 68; sh: 48
file content (10 lines) | stat: -rw-r--r-- 330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
import time
import mitmproxy
from mitmproxy.script import concurrent


@concurrent  # Remove this and see what happens
def request(flow):
    mitmproxy.ctx.log("handle request: %s%s" % (flow.request.host, flow.request.path))
    time.sleep(5)
    mitmproxy.ctx.log("start  request: %s%s" % (flow.request.host, flow.request.path))