mirror of
https://github.com/MatthewL246/mitmproxy-pretendo.git
synced 2026-04-24 15:26:54 -05:00
Merge branch 'reverse-proxy'
* reverse-proxy: Also disable insecure SSL settings Configuration updates for HTTP/2 and caching Add support for rverse redirection Also redirect nintendowifi.net for 3DS Replace request host header instead of host Update addon script to work with reverse proxy Set up reverse proxy config
This commit is contained in:
commit
a44495f59c
|
|
@ -1,14 +1,14 @@
|
|||
# See https://docs.mitmproxy.org/stable/concepts-options/ for documentation
|
||||
|
||||
# An easy-to-remember port that should not conflict with anything
|
||||
listen_port: 2240
|
||||
web_port: 8088
|
||||
listen_port: 8888
|
||||
web_port: 8089
|
||||
mode: reverse:http://127.0.0.1:81
|
||||
keep_host_header: true
|
||||
block_global: false
|
||||
|
||||
# These settings make sure that connections are not blocked because they use an
|
||||
# old version of TLS.
|
||||
ssl_insecure: true
|
||||
tls_version_server_min: UNBOUNDED
|
||||
tls_version_client_min: UNBOUNDED
|
||||
# Disable HTTP/2 support, as it seems buggy and is not necessary
|
||||
http2: false
|
||||
|
||||
# These just make sure that the right configuration files and certs are loaded.
|
||||
client_certs: ./client-certificates/WiiU-common.pem
|
||||
|
|
@ -16,11 +16,10 @@ confdir: ./configuration
|
|||
|
||||
# This enables the Pretendo redirection script.
|
||||
scripts: ["./pretendo_addon.py"]
|
||||
|
||||
# This simply attempts makes sure that no requests are cached.
|
||||
anticache: true
|
||||
pretendo_redirect: true
|
||||
|
||||
# A couple convenience features
|
||||
console_focus_follow: true
|
||||
showhost: true
|
||||
console_palette: dark
|
||||
console_layout: vertical
|
||||
|
|
|
|||
|
|
@ -19,9 +19,13 @@ class PretendoAddon:
|
|||
|
||||
def request(self, flow: http.HTTPFlow) -> None:
|
||||
if ctx.options.pretendo_redirect:
|
||||
if 'nintendo.net' in flow.request.host:
|
||||
flow.request.host = flow.request.host.replace('nintendo.net', 'pretendo.cc')
|
||||
|
||||
if 'nintendo.net' in flow.request.pretty_host:
|
||||
flow.request.host_header = flow.request.pretty_host.replace('nintendo.net', 'pretendo.cc')
|
||||
elif 'nintendowifi.net' in flow.request.pretty_host:
|
||||
flow.request.host_header = flow.request.pretty_host.replace('nintendowifi.net', 'pretendo.cc')
|
||||
elif 'rverse.club' in flow.request.pretty_host:
|
||||
flow.request.host_header = flow.request.pretty_host.replace('rverse.club', 'pretendo.cc')
|
||||
|
||||
if ctx.options.pretendo_http:
|
||||
flow.request.scheme = 'http'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user