feat: introduce mitmproxy

This commit is contained in:
Fishia
2026-03-17 01:00:18 -07:00
committed by Melledy
parent 574cbb34ba
commit 942be7236a
3 changed files with 42 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
@echo off
REM -- We utilize mitmproxy's local redirector mode to *only* proxy Stella Sora.
REM -- https://www.mitmproxy.org/posts/local-capture/windows/
mitmweb -k -m wireguard --set stream_large_bodies=3m --set block_global=false --mode local:StellaSora.exe -s proxy.py
pause >nul
+20
View File
@@ -0,0 +1,20 @@
from mitmproxy import ctx, http
from mitmproxy.proxy import layer
# If you use any client other than the global client,
# add their appropriate endpoints here (SDK and server)
TARGET_HOSTS = [
"en-sdk-api.yostarplat.com",
"nova.stellasora.global",
]
# Nebula server address
SERVER_HOST = "127.0.0.1"
SERVER_PORT = 80 # Make sure to modify this according to your config.json file!
def request(flow: http.HTTPFlow) -> None:
if flow.request.pretty_host in TARGET_HOSTS:
flow.request.scheme = 'http'
flow.request.host = SERVER_HOST
flow.request.port = SERVER_PORT
return