Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
b38d5b19
Commit
b38d5b19
authored
Apr 21, 2022
by
Jaida Wu
Browse files
Add port & SSL options to proxy script
Signed-off-by:
Jaida Wu
<
mlgmxyysd@meowcat.org
>
parent
4c1dc34c
Changes
2
Show whitespace changes
Inline
Side-by-side
proxy.py
View file @
b38d5b19
...
@@ -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
()
...
...
proxy_config.py
View file @
b38d5b19
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment