From e6b59f235663557ade447d031207d4e1d15557da Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 2 Jul 2024 20:09:02 +0400 Subject: [PATCH] feat: add redirecting addon for testing server --- test_addon.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test_addon.py diff --git a/test_addon.py b/test_addon.py new file mode 100644 index 0000000..eba535c --- /dev/null +++ b/test_addon.py @@ -0,0 +1,10 @@ +from mitmproxy.http import HTTPFlow + + +def requestheaders(flow: HTTPFlow) -> None: + host = flow.request.pretty_host + flow.request.host = '127.0.0.1' + flow.request.port = 4001 + flow.request.headers['X-Forwarded-Proto'] = flow.request.scheme + flow.request.scheme = 'http' + flow.request.host_header = host