feat: add redirecting addon for testing server
This commit is contained in:
parent
95f280663b
commit
e6b59f2356
1 changed files with 10 additions and 0 deletions
10
test_addon.py
Normal file
10
test_addon.py
Normal 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
|
Loading…
Reference in a new issue