Why system-wide socks proxy doesn’t work for Chrome

google-chromeNetworkPROXY

First of all, I'm not asking how to enable proxy in Chrome. I've already done it with SwitchySharp extension.

The question I'm about to ask, is the mechanism under OSX's network preference setting and chrome's mechanism.

The phenomenon:

I used ssh -D 7001 my_user@my_host to build a local socks server.
And I set System Preferences -> network -> current_wifi -> Advanced -> Proxies -> "Select" SOCKS Proxy -> "Input" 127.0.0.1:7001
At this time point, when I use safari to open a website, it use this 7001 socks proxy, but when use chrome, it doesn't.

So, when I set that socks proxy parameters in System Preferences, what did OSX do? And how did Chrome bypass this socks proxy setting?

Best Answer

It isn't that Chrome bypassed it, it "ignores" it (because it might not have implemented reading the values).

I did find some docs that show how to manually set Chrome on Mac to use SOCKS:

https://www.chromium.org/developers/design-documents/network-stack/socks-proxy

(if my memory bank properly translated what I read).

I couldn't find any docs from Google that said: Chrome on MacOS will obey SOCKS prefs.

Before someone down votes this because it sounds incorrect...

Proxy support for apps usually comes down to three things:

Support for HTTP proxy (FTP is really HTTP), HTTPS (Connect) and SOCKS of two versions.

Each of these is pretty different than the other, but the standard dialog boxes originally designed by Netscape made them look like they were simply operating in parallel. Users assume that a browser that works with one setting in the dialog should work with all the others, that simply isn't true from a feature/support/protocol/code perspective.

For MacOS browsers, the browser developer had to decide if they would support the proxy type, and then how would they read the system settings, if they supported the system settings. This is why for a long time Camino (Mozilla browser for MacOS-only supported OS settings, but Firefox (Mozilla browser for all platforms) did not.

(As best as I can remember... I was Proxy QA for Netscape/Mozilla back in the day.)