Discard a response that satisfies a specific criteria?


#1

Hi, I am wondering whether it is possible for mitmproxy to selectively discard the http responses from a specific host.
For example, suppose we access web sites A and B through mitmproxy, then for the response from A we redirect them to the client; while the response from site B will be silently discarded by the mitmproxy.


#2

Hi @ppsun,

You could write a mitmproxy script that just calls flow.kill() for the responses you want to discard. Does that help?


#3

Definitely. Thanks for your help!