def tcpdump(self, pytestconfig):
        """Initialize a sniffer to capture curl's traffic."""
        interface = pytestconfig.getoption("capture_interface")

        logging.debug(
            f"Running tcpdump on interface {interface}"
        )

        p = subprocess.Popen([
            "tcpdump", "-n",
            "-i", interface,
            "-s", "0",
            "-w", "-",
            "-U", # Important, makes tcpdump unbuffered
            (f"(tcp src portrange {self.LOCAL_PORTS[0]}-{self.LOCAL_PORTS[1]}"
             f" and tcp dst port 443) or"
             f"(tcp dst portrange {self.LOCAL_PORTS[0]}-{self.LOCAL_PORTS[1]}"
             f" and tcp src port 443)")
        ], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

        yield p

        p.terminate()
        p.wait(timeout=10)
Initialize a sniffer to capture curl's traffic.
tests/test_impersonate.py