With regard to port numbers, ATS will by default go to port number specified in
the request header. So if the request is for "http://google.com" ATS will
connect to port 80 on google.com regardless of what port the user agent
connected to for explicit proxy (where the user agent hits ATS explicitly).
In transparent mode ATS will use the same port as the client connected to. You
can also set it to use the same source port
(proxy.config.http.use_client_source_port INT 1).
I will note forward proxies are much harder to make now because of HTTPS.
Unless you have certificates for the destinations ATS can only do a pass
through which is not useful if that's the only thing it does.