Here's the scenario: I have a proxy, that when Chrome is setup to map requests to, records the requests from Chrome + the responses from the real server. It records all of this in a special format, so replacing this service with another is impossible. This proxy listens on
127.0.0.443, and ships requests out directly to the network via Python (source can be found in the above link).
The issue is, I don't want to access any normal old site via Chrome to record the response...I need to modify the response in a few ways from the server. Mitm proxy is perfect for this, and I have it setup with a root cert to modify the specific things I need for clients using this proxy.
My issue is that I can only seem to use one or the other. Either:
- Chrome can forward requests ==> recording proxy, which sends requests ==> the network (bypassing the mitm proxy), or
- Chrome can forward requests ==> mitm proxy, which sends requests ==> the network, and manipulates the responses that Chrome sees in the way I want (but bypassing the recording proxy)
I'm having difficulty chaining these two together, so that the recording proxy records altered responses from the mitm proxy. I figured one way to do it would be have Chrome map requests ==> recording proxy (via cli flags), and set my system-level proxy settings to map everything to the mitm proxy, but that just overrode Chrome's settings and bypassed the recording proxy. It seems difficult to make one proxy stand in front of another, instead of both side-by-side, if that makes sense.
So what I really need to know is: is there a way I can make the recording proxy, which sends requests directly to the web, instead forward its traffic to the mitm proxy, so it can manipulate the responses that get recorded.
I'm hoping this can be done without much, if any, modification of the recording proxy, and instead just redirect all of the traffic from its process or something. Thanks in advance :)