How to make only one domain pass through the proxy?

Greetings ! :disappointed_relieved:


In the middle of all traffic passing through the proxy, only when a domain is accessed does the sniff. If it is not the domain “”, the sites can be processed without interception action.


import mitmproxy

address = ""

def request(flow):
         if != address:
               print("THIS FLOW IS TRASH")

def make_disconnect_request(address):
    return HTTPRequest(
        "authority", b"DISCONNECT", None, None, None, None, b"HTTP/1.1",
        http.Headers(), b""

I know that sending a request asking to disconnect will not cause the other domains to stop going through the proxy, but the idea is to make those who do not act or even process the requests, they just follow their normal traffic as if they were not being sniffed.

Sry my english, i’m brazilian.