How to use console replace command?

I’m trying to use mitmproxy as a content filter proxy, but isn`t work. How to use it? Can somebody point me to any manual? I found just but when i started mitmdump -replace :~q:tester:testerONE and visit nothing changed… Tnx.

~q only replaces stuff in requests, not responses - what did you expect to happen?

So, i need to change web content, like as in privoxy, but for https. Is it possible? if yes, then how?

~q means that you only want to apply changes to requests. You want ~s. :smiley:

Nice!! Thanks!!

but… next question:
is it posiible to use lists of replacements from command line? i.e. any file or files with replacements rules like as

pattern1 -> replacement1
pattern2 -> replacement2
pattern3 -> replacement3
pattern4 -> replacement4

Sure, you can pass --replace multiple times.

but next question
how to use python regex for multiline matches in you notation?
i tried use something like this:
–replace :~s:(?m<script.*?):killjs
but mitm fall down