Can mitmproxy be used to drop traffic to specific destinations

So I am a mitmproxy newb and I have an awkward network situation. I am considering if mitmproxy can help. However a search in docs and forums so far has not been conclusive.

My use case is that I wish to drop traffic

The version I am using is v0.15 (its what the version of ubuntu supports).

I see from other discussions for this version that I want a limit filter (l) however its not clear to me the syntax for the filter exactly. An example would be great. I am familiar with regex so I am comfortable with the domain/ip regex I need. However its not clear to me exactly how that would be entered at the prompt. Using as a guide I am guessing I would enter ~hq host:regex at the Limit: prompt.

But it does not appear to help.


0.15 is pretty old - I would recommend using the latest stable in any case. :slight_smile:

There are a couple of examples on the docs page you linked to - what’s the condition you want to filter on?

By filter do you mean - to not display on screen when it arrives at the proxy? I wish to drop the request from being sent on which I gather from testing is not a feature that MITMPROXY provides.