diff --git a/scripts/proxy.py b/scripts/proxy.py index 654bbb91..2a5e9de6 100755 --- a/scripts/proxy.py +++ b/scripts/proxy.py @@ -58,8 +58,15 @@ def processFile (flow, content, ext): print(''.join(lines)) return content +if mitmversion >= 0.18: + def start(): + _start(sys.argv) +else: + def start(context, argv): + _start(argv) + # Example usage: "proxy.py --no-cache --ignore http://cdn.com/jalangi --inlineIID --inlineSource --noResultsGUI --analysis ..." -def start(context, argv): +def _start(argv): global jalangiArgs global useCache @@ -85,8 +92,16 @@ def mapper(p): return path if not p.startswith('--') and (os.path.isfile(path) or os.path.isdir(path)) else p jalangiArgs = ' '.join(map(mapper, [x for x in argv[1:]])) -@concurrent -def response(context, flow): +if (mitmversion >= 0.18): + @concurrent + def response(flow): + _response(flow) +else: + @concurrent + def response(context, flow): + _response(flow) + +def _response(flow): # Do not invoke jalangi if the domain is ignored for path in ignore: if flow.request.url.startswith(path):