Skip to content

Instantly share code, notes, and snippets.

@monsat
Created May 2, 2012 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monsat/2574455 to your computer and use it in GitHub Desktop.
Save monsat/2574455 to your computer and use it in GitHub Desktop.
SOCKS Proxy by mac
#!/bin/sh
PROXY="$1"
PORT=1080
if [ "$2" != "" ]
then
PORT=$2
fi
if [ $# -eq 0 ]
then
echo "${0} [ServerName] [PortNumber = 1080]"
echo "(ssh -D ${PORT} [ServerName])"
exit
fi
networksetup -setsocksfirewallproxystate Ethernet on
networksetup -setsocksfirewallproxystate Wi-Fi on
ssh -D ${PORT} ${PROXY}
networksetup -setsocksfirewallproxystate Ethernet off
networksetup -setsocksfirewallproxystate Wi-Fi off
@monsat
Copy link
Author

monsat commented May 2, 2012

@monsat
Copy link
Author

monsat commented May 2, 2012

システム環境設定>ネットワーク>詳細>プロキシ
SOCKSプロキシサーバに localhost:1080 等と設定する

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment