properly pass ip into proy script

This commit is contained in:
SpikeHD 2022-04-19 19:33:17 -07:00
parent 7bfb9a7113
commit baceadf8cc
2 changed files with 15 additions and 3 deletions

View File

@ -6,7 +6,10 @@ SET ip=%1
SET gamePath=%2
SET gamePath=%gamePath:"=%
start "Proxy Server" ./ext/mitmdump.exe -s "./proxy/proxy.py" --ssl-insecure
start "Proxy Server" ./ext/mitmdump.exe -s "./proxy/proxy.py" --ssl-insecure --set ip=%ip%
:: Allow the proxy to start
ping 192.0.2.2 -n 1 -w 5000 > nul
echo Opening %gamePath%/Genshin Impact Game/GenshinImpact.exe

View File

@ -20,14 +20,23 @@
#
##
import string
from mitmproxy import ctx
from mitmproxy import http
class MlgmXyysd_Genshin_Impact_Proxy:
def request(self, flow: http.HTTPFlow) -> None:
def load(self, loader):
loader.add_option(
name = "ip",
typespec = str,
default = "localhost",
help = "IP address to replace",
)
def request(self, flow: http.HTTPFlow) -> None:
# This can also be replaced with another IP address.
REMOTE_HOST = "localhost"
REMOTE_HOST = ctx.options.ip
LIST_DOMAINS = [
"api-os-takumi.mihoyo.com",