mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 22:22:51 +00:00
Add port & SSL options to proxy script
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
This commit is contained in:
parent
56415b7fbc
commit
ced378cee8
9
proxy.py
9
proxy.py
@ -16,12 +16,14 @@
|
||||
# - mitmdump from mitmproxy
|
||||
#
|
||||
# @author MlgmXyysd
|
||||
# @version 1.0
|
||||
# @version 1.1
|
||||
#
|
||||
##
|
||||
|
||||
from mitmproxy import http
|
||||
from proxy_config import USE_SSL
|
||||
from proxy_config import REMOTE_HOST
|
||||
from proxy_config import REMOTE_PORT
|
||||
|
||||
class MlgmXyysd_Genshin_Impact_Proxy:
|
||||
|
||||
@ -60,7 +62,12 @@ class MlgmXyysd_Genshin_Impact_Proxy:
|
||||
|
||||
def request(self, flow: http.HTTPFlow) -> None:
|
||||
if flow.request.host in self.LIST_DOMAINS:
|
||||
if USE_SSL:
|
||||
flow.request.scheme = "https"
|
||||
else:
|
||||
flow.request.scheme = "http"
|
||||
flow.request.host = REMOTE_HOST
|
||||
flow.request.port = REMOTE_PORT
|
||||
|
||||
addons = [
|
||||
MlgmXyysd_Genshin_Impact_Proxy()
|
||||
|
@ -1,2 +1,4 @@
|
||||
# This can also be replaced with another IP address.
|
||||
REMOTE_HOST = "localhost"
|
||||
USE_SSL = True
|
||||
REMOTE_HOST = "127.0.0.1"
|
||||
REMOTE_PORT = 443
|
Loading…
Reference in New Issue
Block a user