hacker1024/mitmproxy_httptoolkit_android

AttributeError: 'snicstats' object has no attribute 'flags'

Opened this issue · 0 comments

Like this code problem on linux:
if_addrs = psutil.net_if_addrs()
if_stats = psutil.net_if_stats()
for interface, addresses in if_addrs.items():
flags = typing.cast(str, if_stats[interface].flags).split(",")

        if (
            "loopback" in flags  # Loopback interfaces
            or interface == "docker0"  # Docker default bridge interface
            or interface.startswith("br-")  # More docker bridge interfaces
            or interface.startswith(
                "veth"
            )  # Virtual interfaces for each docker container
        ):
            continue

I trued your addon for httptoolkit, but it doesn't work with CA mitmproxy, had a blockage TLS certificate by google.
Work only using httptoolkit CA and httptoolkit server/API. If you solve problem and sniff all trafic, explane how you do that with mitmproxy CA.

So, that problem for AttributeError: 'snicstats' object has no attribute 'flags', it helps me.
if_address = psutil.net_if_addrs()
if_stats = psutil.net_if_stats()
for interface, addresses in if_address.items():
stats = if_stats[interface]
if hasattr(stats, 'flags'):
flags = typing.cast(str, stats.flags).split(",")
else:
flags = []

        if (
                "loopback" in flags  # Loopback interfaces
                or interface == "lo"  # loopback interface is usually called “lo”
                or interface == "docker0"  # Docker default bridge interface
                or interface.startswith("br-")  # More docker bridge interfaces
                or interface.startswith("veth")  # Virtual interfaces for each docker container
        ):
            continue