You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or 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
* [how-do-i-set-up-a-linux-proxy-for-my-mac by askubuntu](http://askubuntu.com/questions/143303/how-do-i-set-up-a-linux-proxy-for-my-mac)
# Socks 5 in Terminal
## Using Proxychains-ng to socksify your command
* Install `proxychains-ng` by running `brew install proxychains-ng`.
* Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.
```config
[ProxyList]
socks5 127.0.0.1 1080
```
* Add `proxychains4` to the front of every command, e.g. `proxychains4 curl ipecho.net/plain`
> Also works for Application like `Google Chrome` while `Safari` does not work, try `proxychains4 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome `.
> But this might slow down Chrome.
> You can also use [dsocks](http://monkey.org/~dugsong/dsocks/) for mac(which does not work for me), [tsocks](http://tsocks.sourceforge.net/) for linux.
## Using Unix Proxy Environment Variable
Add this script to `~/.bash_profile`.
```sh
export http_proxy=socks5://127.0.0.1:1080
export https_proxy=socks5://127.0.0.1:1080
```
## 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.
```config
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.