Skip to content

Commit

Permalink
Add port & SSL options to proxy script
Browse files Browse the repository at this point in the history
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
  • Loading branch information
MlgmXyysd committed Apr 21, 2022
1 parent 56415b7 commit ced378c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion proxy_config.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ced378c

Please sign in to comment.