Commit b38d5b19 authored by Jaida Wu's avatar Jaida Wu
Browse files

Add port & SSL options to proxy script


Signed-off-by: default avatarJaida Wu <mlgmxyysd@meowcat.org>
parent 4c1dc34c
...@@ -16,12 +16,14 @@ ...@@ -16,12 +16,14 @@
# - mitmdump from mitmproxy # - mitmdump from mitmproxy
# #
# @author MlgmXyysd # @author MlgmXyysd
# @version 1.0 # @version 1.1
# #
## ##
from mitmproxy import http from mitmproxy import http
from proxy_config import USE_SSL
from proxy_config import REMOTE_HOST from proxy_config import REMOTE_HOST
from proxy_config import REMOTE_PORT
class MlgmXyysd_Genshin_Impact_Proxy: class MlgmXyysd_Genshin_Impact_Proxy:
...@@ -60,7 +62,12 @@ class MlgmXyysd_Genshin_Impact_Proxy: ...@@ -60,7 +62,12 @@ class MlgmXyysd_Genshin_Impact_Proxy:
def request(self, flow: http.HTTPFlow) -> None: def request(self, flow: http.HTTPFlow) -> None:
if flow.request.host in self.LIST_DOMAINS: 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.host = REMOTE_HOST
flow.request.port = REMOTE_PORT
addons = [ addons = [
MlgmXyysd_Genshin_Impact_Proxy() MlgmXyysd_Genshin_Impact_Proxy()
......
# This can also be replaced with another IP address. # This can also be replaced with another IP address.
REMOTE_HOST = "localhost" USE_SSL = True
\ No newline at end of file REMOTE_HOST = "127.0.0.1"
REMOTE_PORT = 443
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment