Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my laptop I usually have a ssh connection open and use the remote machine as a proxy server just so that all my network traffic is over ssh. I know that it's hopeless and we're all doomed, but it makes me feel a little better.

Problem is sometimes I need to set and unset it for some reason and then I have to dig through millions of dialogs to get to here...

enter image description here that I can uncheck that option.

Is there a faster way to do that or a way I can set up a script to turn "SOCKS Proxy" on and off? Probably something with Applescript, right?

Is there a way to do this without learning Applescript?

share|improve this question
This method is really inefficient, btw. You are tunnelling TCP over TCP, and it slows things down a lot. Check SSHuttle for one solution, or use a vpn. – chiggsy Dec 1 '12 at 13:53
up vote 5 down vote accepted

Set up two locations - one with proxy one - one off - you are an Apple menu item away from the switch.

Apple Menu

Just select network, then edit the locations.


share|improve this answer

If you use Alfred, you can try a variant of this extension:

e=$(networksetup -getsocksfirewallproxy wi-fi | grep "No")

if [ -n "$e" ]; then
  echo "Turning on proxy"
  networksetup -setsocksfirewallproxystate wi-fi on
  echo "Turning off proxy"
  networksetup -setsocksfirewallproxystate wi-fi off

For more information, look up the networksetup command line function. (Note that you may need to change wi-fi above to something else -- ethernet for wired connections, or airport if you're on Snow Leopard.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.