Linux 下 shadowsocks + polipo 客戶端全域性代理
阿新 • • 發佈:2018-12-12
shadowsocks
1234567 | ##Ubuntu下的安裝sudoapt-getinstallpython-pipsudopipinstallshadowsocks# |
建立配置檔案,例:伺服器地址為 xxxx.com,埠號 52239,密碼 SOME_PASSWORD,儲存到 ~/shadowsocks.json
12345678910 | {"server":"xxxx.com","server_port":52239,"local_address":"127.0.0.1","local_port":1080,"password":"SOME_PASSWORD","timeout":600,"method":"aes-256-cfb","fast_open":false} |
12 | ##啟動shadowsockssudosslocal-c~/shadowsocks.json-dstart |
安裝 polipo
使用 polipo 進行二次轉發
12345 | ##Ubuntu下的安裝sudoapt-getinstallpolipo##CentOS下的安裝sudoyuminstallpolipo |
編輯配置檔案,儲存到 /etc/polipo/config
123456789101112131415161718 | #Thisfileonlyneedstolistconfigurationvariablesthatdeviate#fromthedefaultvalues.See/usr/share/doc/polipo/examples/config.sample#and"polipo -v"forvariablesyoucantweakandfurtherinformation.logSyslog=truelogFile=/var/log/polipo/polipo.logproxyAddress="0.0.0.0"socksParentProxy="127.0.0.1:1080"socksProxyType=socks5chunkHighMark=50331648objectHighMark=16384serverMaxSlots=64serverSlots=16serverSlots1=32 |
12 | ##重啟服務sudoservicepoliporestart |
如果需要終端使用代理,需要設定環境變數:
123 | exporthttp_proxy="http://127.0.0.1:8123"exporthttps_proxy="http://127.0.0.1:8123"exportftp_proxy="http://127.0.0.1:8123" |
可以將此指令碼放到 /etc/profile 檔案中以便開機啟動。
全域性代理
在Ubuntu中可以使用系統自帶的network proxy工具實現,見截圖:
參考連結: