Working with HTTPS Proxies

Hi, we have node app running on Kubernetes that needs to make Egress comms to two different hosts.
One is on the web (login.microsoftonline.com) and needs to go via a Squid proxy.
Other requests can just go via an Egress Gateway which we have set up.

I found this which details how to integrate with a proxy: https://istio.io/latest/docs/tasks/traffic-management/egress/http-proxy/

What that does (correct me if i’m wrong) is exposes the proxy to the container, so that the app can connect to the proxy e.g. via curl HTTPS_PROXY=$PROXY_IP:$PROXY_PORT curl https://login.microsoftonline.com

Unfortunately though we are using a Microsoft library that requires access to login.microsoftonline.com, but does not let us configure it to use a proxy… As a result I was hoping I could do this proxying at infrastructure level.

Is there anyway that we could configure Istio to conditionally route traffic via a proxy without us having to explicitly use it in application code? e.g.

  • If Host = microsoftonline -> proxy the request via SQUID
  • if Host != microsoftonline -> route the request as normal

Many thanks in advance,
Ed