Shadowsocks即有服務端還有專門的客戶端,支持全平臺,神馬Windows、Linux、Mac、Android、iOS、OpenWrt...統統都支持。下麵主要介紹server和client的安裝過程。 ...
***即有服務端還有專門的客戶端,支持全平臺,神馬Windows、Linux、Mac、Android、iOS、OpenWrt...統統都支持。下麵主要介紹server和client的安裝過程。
一、Clients
平臺 | 下載地址 |
---|---|
Windows | shadowsocks-win: GitHub,百度雲盤 密碼: g3ra ***-Qt5: GitHub,百度雲盤 密碼: q5kw |
Mac OS X | ***X-NG: GitHub |
Linux | ***-Qt5: GitHub |
Android | shadowsocks-android:Google Play |
iOS | Potatso:App Store |
OpenWRT | opkg install shadowsocks-libev |
客戶端就是一個啟動文件,雙擊它啟動,右下角有個紙飛機的圖標就是它了。右鍵點擊圖標->伺服器->編輯伺服器,如圖:
革命尚未成功,同志仍需努力。還得在瀏覽器裝個擴展程式,比如SwitchyOmega 或 SwitchySharp什麼的都可以。
有了客戶端,沒有服務端可連接怎麼辦?可以自己買台國外的vps安裝一下就可以了,或者去網上買收費的。
二、Servers
Python版
pip install shadowsocks
沒有安裝pip,Centos用戶使用以下命令:
yum install python-setuptools
easy_install pip
Debian 和 Ubuntu:
sudo apt-get install python-pip
Go版
go get github.com/shadowsocks/shadowsocks-go/cmd/shadowsocks-server
C with libev
sudo apt-get install --no-install-recommends build-essential autoconf libtool \
libssl-dev gawk debhelper dh-systemd init-system-helpers pkg-config asciidoc \
xmlto apg libpcre3-dev zlib1g-dev libev-dev libudns-dev libsodium-dev
git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
git submodule update --init
./autogen.sh && ./configure && make
sudo make install
啟動Server端
編寫/etc/shadowsocks.json配置文件,如下:
{
"server":"0.0.0.0",
"server_port":8388,
"local_port":1080,
"password":"barfoo!",
"timeout":600,
"method":"aes-256-cfb"
}
配置參數說明:
- server: your hostname or server IP (IPv4/IPv6).
- server_port: server port number.
- local_port: local port number.
- password: a password used to encrypt transfer.
- timeout: connections timeout in seconds.
- method: encryption method, "bf-cfb", "aes-256-cfb", "des-cfb", "rc4", etc. Default is table, which is not secure. "aes-256-gcm" is recommended.
啟動命令:
ssserver -c /etc/shadowsocks.json -d start --log-file /tmp/shadowsocks.log
所有啟動參數:
Proxy options:
-c CONFIG path to config file
-s SERVER_ADDR server address, default: 0.0.0.0
-p SERVER_PORT server port, default: 8388
-k PASSWORD password
-m METHOD encryption method, default: aes-256-cfb
-t TIMEOUT timeout in seconds, default: 300
--fast-open use TCP_FASTOPEN, requires Linux 3.7+
--workers WORKERS number of workers, available on Unix/Linux
--forbidden-ip IPLIST comma seperated IP list forbidden to connect
--manager-address ADDR optional server manager UDP address, see wiki
General options:
-h, --help show this help message and exit
-d start/stop/restart daemon mode
--pid-file PID_FILE pid file for daemon mode
--log-file LOG_FILE log file for daemon mode
--user USER username to run as
-v, -vv verbose mode
-q, -qq quiet mode, only show warnings/errors
--version show version information
三、Http代理
shadowsocks需通過socks5協議進行代理,有時候我們需要通過http協議代理怎麼辦呢?我可以通過polipo
將socks5協議轉換為http協議。
- 安裝polipo(github地址:https://github.com/jech/polipo)
git clone https://github.com/jech/polipo.git
cd polipo
make all
make install
- 配置polipo
vim /etc/polipo/config
socksParentProxy = localhost:1080
proxyPort = 8787
- 啟動測試polipo
service polipo restart
curl -x 127.0.0.1:8787 ip.sb
恭喜成功!
- 也可以使用privoxy進行轉換(官網:http://www.privoxy.org/)
sudo apt-get install privoxy
sudo vim /etc/privoxy/config
forward-socks5 / 127.0.0.1:1080 .
listen-address localhost:8118
參考資料
官網
https://shadowsocks.org/en/index.html 官網地址得FQ才能訪問。