Created
May 2, 2012 06:29
-
-
Save monsat/2574455 to your computer and use it in GitHub Desktop.
SOCKS Proxy by mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
システム環境設定>ネットワーク>詳細>プロキシ
SOCKSプロキシサーバに localhost:1080 等と設定する
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the entry. http://d.hatena.ne.jp/seaborgium/20111227/1324993156