24

I use SwitchySharp to quick switch between multi-proxies under Chrome broswer.

Now I want to move to Safari(I love its "Tap to Zoom" feature), but SwitchySharp only works in Chrome, there is no a counterpart in Safari extension.

So I wonder if there is a system level quick proxy switcher script or free app?

54

Have you tried using the Locations feature?

  1. Go to System Preferences > Network,
  2. Click on the "Location" dropdown menu,
  3. Choose "Edit Locations",
  4. Click on the add button and give the location a name. I would suggest you give it a name that's related to the proxy,
  5. Now that you've setup a new location, go through the networking configuration, ensuring you set the relevant proxy setting under the "Proxies" tab, which can be found under the Ethernet/WiFi adapter settings > Advanced.

Repeat steps 1-5 for each proxy.

Once you've finished, you can quickly switch between each proxy by clicking on the Apple icon (located at the top left of your screen) and going to "Location". Once the Location menu expands, you should see all your different locations, which have the relevant proxy settings within them. Clicking on the locations will change the proxy settings your Mac uses.

| improve this answer | |
  • 3
    possible to automatically switch location based on the currently available WiFi network? – ryenus Mar 18 '15 at 3:29
  • if it be possible to define shortcut for it it will be excellent – ali Mar 24 '18 at 10:50
4

I just found ControlPlane, lasted version is 1.6.5.

It's a great application that can take certain actions upon certain context change events, e.g. context change event can be connected to a specified WiFi network (per SSID), and action can be switch locations, hence uses location specific proxies.

And here is a step-by-step guide, which explains how to achieve this using ControlPlane.

| improve this answer | |
  • This allows much more than Proxy on/off feature! Anyone should be aware of this tool. – Pascal Jun 3 '16 at 11:33
0

Thanks to those who helped me, I want to share this and hope this comes in useful for you.

I wrote a simple code and put it into this path ~/Library/Scripts

Then in Script Editor.app under Preferences tab I enabled Show Script menu in menubar

set socksStatus to do shell script "networksetup -getsocksfirewallproxy Wi-fi | grep Enabled"

if (offset of "Yes" in socksStatus) = 0 then
    do shell script "networksetup -setsocksfirewallproxystate Wi-fi On"
    display notification "Proxy Enabled !"
else
    do shell script "networksetup -setsocksfirewallproxystate Wi-fi Off"
    display notification "Socks disabled"

end if

as you can see, when you run the code it enable the proxy and if you run it again it will be disable.

Have a great day !

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .