add mitmproxy script

This commit is contained in:
mkbka 2024-06-03 19:39:37 +08:00
parent 4d3372beb0
commit b20b695f11
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
from mitmproxy import http
SERVER_HOST = 'YOUR_SERVER_HERE'
SERVER_PORT = 80
REWRITE_HOST_LIST = [
'ba-jp-sdk.bluearchive.jp',
'prod-gateway.bluearchiveyostar.com',
'prod-game.bluearchiveyostar.com',
# 'prod-notice.bluearchiveyostar.com',
# 'prod-logcollector.bluearchiveyostar.com',
]
def request(flow: http.HTTPFlow) -> None:
if flow.request.pretty_host.endswith('log.aliyuncs.com'):
flow.kill()
return
if flow.request.pretty_host in REWRITE_HOST_LIST:
flow.request.scheme = 'http'
flow.request.host = SERVER_HOST
flow.request.port = SERVER_PORT
return