hmmm, tuff one. dont think it's possible do do this directly
counter question, why do you wish to limit traffic ? If you could do this, say through a network config of some kind, it owuld negatively impact build time.
From experience things that have an impact on traffic between agent and sever :
Artifacts: if you are storing artifacts within your builds ...
Your challenges are:
Service discovery (usually DNS-based, but there are other approaches)
Load balancing for multiple instances of services (server-side with a load balancer, or client-side with smart service discovery)
Retry and circuit breaker
There are few patterns
API Gateway routing traffic for API calls not only for external traffic ...
The question is: why use a proxy to communicate both applications? What is the point or target (support SSL, security, availability between services?
In any case, you need 2 proxies, one in each app, in front of each application, it is the best way to use it.
You can also use tunnels, like SSH tunnel or Stunnel that support TLS
Do you have network constraints to create a new subnet or what is the reason?
if it's not useful at all, you can just map the port and open the firewall of your PC so that the other machines can see the application.