I have a very specific testing situation where I want to use a forward proxy like so:

Client -> Forward Proxy 1 -> Forward Proxy 2 (WireMock)
                          -> Internet

Forward Proxy 1 would be responsible for forwarding requests for a whitelist of (destination) hosts to Forward Proxy 2 (WireMock), which may send back a mock response or may proxy further to the client's intended destination host. All other (non-whitelisted) requests should be proxied directly to the client's intended destination host by Forward Proxy 1.

The solution must support HTTPS requests. For the WireMock path, WireMock is acting as a MITM and generating self-signed SSL responses sometimes (which the clients are set up to trust, but I don't know if this is relevant for Forward Proxy 1). This solution needs to be available as a docker image, should be as lightweight as possible, and does not need to be particularly performant.

I've tried figuring out how to configure nginx, Squid, HAProxy like this, but no luck so far. Any pointers on how to attack this?


  • First, you need to choose the proxy software. Use software that was actually designed for forward proxying, such as squid. Then, you need to configure it. If you run into a problem and need help, you can ask specific questions about it. – Michael Hampton Jun 16 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.