a.k.a. what to do when your ISP starts blocking sites :(
Set the SOCKS proxy to local SSH tunnel
networksetup -setsocksfirewallproxy "Ethernet" localhost 8080
To clear the domain and port
networksetup -setsocksfirewallproxy "Ethernet" "" ""
To turn the SOCKS proxy off
networksetup -setsocksfirewallproxystate "Ethernet" off
@luckypoem
EN: You have to execute
networksetup -listnetworkserviceorder
first to identified which network card you want to setthen change the
Ethernet
to your card id.中文: 你必需要先執行
networksetup -listnetworkserviceorder
這道命令來找出你要設定的那個介面卡的名稱然後再把
Ethernet
取代成你要的那名稱EN: Example: If I want to set "Thunderbolt Ethernet 1" to sock proxy on port 2228
中文: 範例: 如果我想要把 "Thunderbolt Ethernet 1" 設成我設定的名稱
[email protected]:~$> networksetup -listnetworkserviceorder
(1) Thunderbolt Ethernet 1
(Hardware Port: Thunderbolt Ethernet, Device: en2)
(2) Thunderbolt Ethernet 2
(Hardware Port: Thunderbolt Ethernet, Device: en2)
[email protected]:~$> networksetup -setsocksfirewallproxy "Thunderbolt Ethernet 1" localhost 2228