Script output usage?


I’m a bit confused on how to use the example scripts provided with mitmproxy. Could someone provide me an example of how a script is supposed to be outputting data?

According to:
I should be able to run a script with mitmdump and receive output from the script in the following manner:

mitmdump  -ns mitmproxy/examples/complex/  -r traffic.mitm -w traffic.har is the script doing the transformation of the mitmdump.

traffic.mitm is a previously generated file using this command: mitmdump -s mitmproxy/examples/complex/ -w traffic.mitm

traffic.har is (from what I understand) supposed to be the output of the script.

What I get instead is just a straight copy of the traffic.mitm into traffic.har.


-w is always used to indicate a mitmproxy dump file as output. The har_dump script defines a (not very convincingly named) hardump option, which is the -w equivalent for har files. For example, you can run mitmproxy like this:

mitmdump -s examples/complex/ -w dump.mitm --set hardump=dump.har

This would produce both a mitmproxy capture and a HAR dump.

1 Like