Read macOS Proxy Settings with scutil --proxy
Use scutil --proxy to distinguish active fixed proxies from saved values and per-destination PAC policy.
scutil --proxyRead the related fields together:
| Configuration | Fields to interpret |
|---|---|
| Fixed HTTP | HTTPEnable (0/1), HTTPProxy and HTTPPort |
| HTTPS or SOCKS | Their corresponding enable, endpoint and port fields |
| Automatic policy | ProxyAutoConfigEnable and ProxyAutoConfigURLString |
A saved host is not an enabled route. For an enabled HTTP endpoint that the receiving client should use as a fixed proxy, the URL has host then port:
http://proxy.example.net:8080A PAC URL identifies a script, not that forwarding listener. Exporting it as HTTP_PROXY loses per-destination decisions. The HTTPS category also does not imply TLS to the intermediary.
Review bypass and scoped configuration before flattening the output into variables, and use the actual command-line client's supported interface.