Skip to content

Instantly share code, notes, and snippets.

@johnagan
Created January 4, 2013 16:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnagan/4453805 to your computer and use it in GitHub Desktop.
Save johnagan/4453805 to your computer and use it in GitHub Desktop.
#!/bin/bash
disable_proxy()
{
networksetup -setsocksfirewallproxystate Wi-Fi off
networksetup -setsocksfirewallproxystate Ethernet off
echo "SOCKS proxy disabled."
}
trap disable_proxy INT
networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999
networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999
networksetup -setsocksfirewallproxystate Wi-Fi on
networksetup -setsocksfirewallproxystate Ethernet on
echo "SOCKS proxy enabled."
echo "Tunneling..."
ssh -ND 9999 your.proxy.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment