Installing juju agent by a proxy

How can I configure juju in order that the juju clients have to use a proxy for downloading the juju agent ?
I can’t install juju clients when they are on a different network of my juju controller.

This is my setup:

  1. mass-region + juju: networkA
  2. juju client: networkB
  3. maas-rackd: networkA+networkB

I create a model with
juju model-config http-proxy=$proxy
juju model-config https-proxy=$proxy
juju model-config snap-http-proxy=$proxy
juju model-config snap-https-proxy=$proxy
juju model-config apt-http-proxy=$proxy
juju model-config apt-https-proxy=$proxy

where $proxy=http://maas-rackd.networkB:8000

running a simple juju charm, it goes pending when trying to download the juju agent onto the clients because every juju client is trying to contact the juju the controller directly and not by the $proxy, this a snipplet from juju status:

Machine State DNS Inst id Series AZ Message
0 pending 172.17.3.12 node1 focal default Deployed

i tried also
juju model-config juju-http-proxy=$proxy
juju model-config juju-https-proxy=$proxy

but it stops at the same point.