feat: add redirecting addon for testing server

This commit is contained in:
DarkCat09 2024-07-02 20:09:02 +04:00
parent 95f280663b
commit e6b59f2356
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

10
test_addon.py Normal file
View file

@ -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