mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 05:04:20 +00:00
Optimize proxy scripts
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
This commit is contained in:
parent
866941589b
commit
087cd680bd
16
proxy.py
16
proxy.py
@ -21,14 +21,10 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
from mitmproxy import http
|
from mitmproxy import http
|
||||||
|
from proxy_config import REMOTE_HOST
|
||||||
|
|
||||||
class MlgmXyysd_Genshin_Impact_Proxy:
|
class MlgmXyysd_Genshin_Impact_Proxy:
|
||||||
|
|
||||||
def request(self, flow: http.HTTPFlow) -> None:
|
|
||||||
|
|
||||||
# This can also be replaced with another IP address.
|
|
||||||
REMOTE_HOST = "localhost"
|
|
||||||
|
|
||||||
LIST_DOMAINS = [
|
LIST_DOMAINS = [
|
||||||
"api-os-takumi.mihoyo.com",
|
"api-os-takumi.mihoyo.com",
|
||||||
"hk4e-api-os-static.mihoyo.com",
|
"hk4e-api-os-static.mihoyo.com",
|
||||||
@ -54,10 +50,16 @@ class MlgmXyysd_Genshin_Impact_Proxy:
|
|||||||
"sdk-os-static.hoyoverse.com",
|
"sdk-os-static.hoyoverse.com",
|
||||||
"api-account-os.hoyoverse.com",
|
"api-account-os.hoyoverse.com",
|
||||||
"hk4e-sdk-os.hoyoverse.com",
|
"hk4e-sdk-os.hoyoverse.com",
|
||||||
"overseauspider.yuanshen.com"
|
"overseauspider.yuanshen.com",
|
||||||
|
"gameapi-account.mihoyo.com",
|
||||||
|
"minor-api.mihoyo.com",
|
||||||
|
"public-data-api.mihoyo.com",
|
||||||
|
"uspider.yuanshen.com",
|
||||||
|
"sdk-static.mihoyo.com"
|
||||||
]
|
]
|
||||||
|
|
||||||
if flow.request.host in LIST_DOMAINS:
|
def request(self, flow: http.HTTPFlow) -> None:
|
||||||
|
if flow.request.host in self.LIST_DOMAINS:
|
||||||
flow.request.host = REMOTE_HOST
|
flow.request.host = REMOTE_HOST
|
||||||
|
|
||||||
addons = [
|
addons = [
|
||||||
|
2
proxy_config.py
Normal file
2
proxy_config.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# This can also be replaced with another IP address.
|
||||||
|
REMOTE_HOST = "localhost"
|
Loading…
Reference in New Issue
Block a user