aboutsummaryrefslogtreecommitdiffstats
path: root/examples/simple/internet_in_mirror.py
blob: 5d3e555d4a69402fc774c8c028340fa1e5bb6163 (plain)
1
2
3
4
5
6
7
8
9
"""
This script reflects all content passing through the proxy.
"""
from mitmproxy import http


def response(flow: http.HTTPFlow) -> None:
    reflector = b"<style>body {transform: scaleX(-1);}</style></head>"
    flow.response.content = flow.response.content.replace(b"</head>", reflector)