Redirect official server requests (#8)

* Update mitm-redirect.py

Redirect official server requests as well as unofficial server requests

* Update mitm-redirect.py

Automatically redirect requests for "media.jumpstart.com" to "media.sodoff.spirtix.com".  This should let you run either the original client or the modified one.

* Update mitm-redirect.py:  Add missing comma

* Update mitm-redirect.py

Re-make commit d382a90; the changes got lost somehow

* Update mitm-redirect.py: Add newly implemented methods to the methods list
This commit is contained in:
J. D 2023-07-21 09:15:17 -05:00 committed by GitHub
parent ad889d3d7a
commit a96a256c11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,11 +79,20 @@ class LocalRedirect:
print('Loaded redirect addon') print('Loaded redirect addon')
def request(self, flow: mitmproxy.http.HTTPFlow): def request(self, flow: mitmproxy.http.HTTPFlow):
if 'api.sodoff.spirtix.com' in flow.request.pretty_host and routable(flow.request.path): if ('api.sodoff.spirtix.com' in flow.request.pretty_host or 'api.jumpstart.com' in flow.request.pretty_host) and routable(flow.request.path):
flow.request.host = "localhost" flow.request.host = "localhost"
flow.request.scheme = 'http' flow.request.scheme = 'http'
flow.request.port = 5000 flow.request.port = 5000
class RedirectMediaRequests:
def __init__(self):
print('Loaded media request redirector')
def request(self, flow: mitmproxy.http.HTTPFlow):
if "media.jumpstart.com" in flow.request.pretty_host:
flow.request.host = "media.sodoff.spirtix.com"
addons = [ addons = [
LocalRedirect() LocalRedirect(),
RedirectMediaRequests()
] ]