I have a back end application stack that acts like a web browser and connects to HTTP and HTTPS servers on the internet through an external HTTP proxy service. This all works great. So we're talking an existing pipeline that looks like this:
<our http client> -> <ext proxy service> -> <ext web site>
Now I want to add a MITM proxy server of our own that intercepts our client requests and modifies them before they are sent to the external proxy service. So I want:
<our http client> -> <our mitm proxy> -> <ext proxy service> -> <ext web site>
Right now, I've got the following pipeline working:
<our http client> -> <our mitm proxy> -> <ext web site>
I've implemented the MITM proxy using LittleProxy, which uses Netty as its underlying network layer package, all written in Java. I'm utilizing an extension to LittleProxy that provides MITM HTTPS support. With very little extra code of my own, this is working great. Now I want to introduce the external proxy back into the pipeline.
Can someone tell me how to cause LittleProxy/Netty to handle the connection to the external web site by way of an external proxy service, getting me to the full pipeline I want? That would be SUPER APPRECIATED!
Alternately, if someone can recommend another starting point than LittleProxy for implementing the MITM server I'm looking for, that might give me the way to go.