Install Shadowsocks Client, e.g. run brew cask install shadowsocksx in macOS.
Only config SOCKS Host to 127.0.0.1:1080 and select SOCKS v5
SOCKS 5 Through SSH Tunnel
1 2 3 4 5
# `-N`: do not execute commands # `-D`: bind 1080 port and forward 1080 port to 22 port # `-i`: use pre-shared key `hello.pem` # `-p`: specify port used to connect to remote server ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22
Config curl to use SOCKS5(Also works for homebrew)
Add the following line to ~/.curlrc. Since homebrew use curl to download the package, this will also enable homebrew to use SOCKS5.
socks5 = "socks5://127.0.0.1:1080"
There are no environment variables for SOCKS5 proxy servers in unix, so in order to use SOCKS5 in other utilities, check the man pages for existing tools to see if they have a configuration option for a SOCKS5 proxy and whether they have a configuration file that the configuration can be added to.
Config git to use SOCKS5
For https:// and http://(e.g. http://github.com, https://github.com), run the following script.