eavesdropper (pypi): Eavesdropper, an application-level gateway firewall proxy, gives you control over all network traffic. Or simply use its integrated mitmproxy 5.3.0 which can be completely controlled with Python code.
Keywords: eavesdropper|proxy|mitm|request|response|network|traffic|firewall|monitor|intercept|manipulate|modify|change|content|headers