MacOS – System-wide SOCKS Proxy Settings

macosNetworkPROXYsocks

If I have a SOCKS proxy running on a specific port, is there a way to configure all network traffic to leave through it?

If I configure the SOCKS proxy in the Network system preference, it seems to work properly for all browsers without additional configuration. (As reported by a quick Google for 'what is my IP' in both Chrome and Safari.)

However, a traceroute does not seem to be using this proxy, nor do downloads using curl. I also have no way of knowing whether other apps like Mail (SMTP) or an SSH connection are using the proxy.

I found the app MacProxy, but it's only a 30-day trial. It seems like there is surely a way to configure this via the command line for free?

Best Answer

There could be a couple of things happening here. OS X support SOCKS v5 but your SOCKS server might still be on v4. The difference is that v5 also routes UDP through the proxy but v4 doesn't

Try traceroute -I destination which will make traceroute use ICMP echo instead of UDP and see if you get a different route.

curl should be using the proxy if you specify it. Try curl --proxy socks5://proxyhost.examplecom:portnumber