From a96a256c11bee59dc2107b34f0e1f61b0b5a1d41 Mon Sep 17 00:00:00 2001 From: "J. D" Date: Fri, 21 Jul 2023 09:15:17 -0500 Subject: [PATCH] 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 --- mitm-redirect.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mitm-redirect.py b/mitm-redirect.py index 4a7c3c7..6a80298 100644 --- a/mitm-redirect.py +++ b/mitm-redirect.py @@ -79,11 +79,20 @@ class LocalRedirect: print('Loaded redirect addon') 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.scheme = 'http' 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 = [ - LocalRedirect() + LocalRedirect(), + RedirectMediaRequests() ]