Add proxy settings for MacOS terminal

MacOS now uses Zsh by default, so look for the .zshrc configuration file in the user's home directory, and create it yourself if not.

Edit the .zshrc file and add the following code at the end

# set proxy alias proxy='export all_proxy=socks5://127.0.0.1:1234' alias unproxy='unset all_proxy'

After adding, save and enter the following command in the terminal

% source ~/.zshrc

complete.

If you need to use a proxy, enter the proxy command in advance. If you need to unproxy, enter the unproxy command.

Or if you need to enable the proxy by default, add it at the end of the .zshrc configuration file

% export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890

save.

% source ~/.zshrc

complete.

zh_CNZH-CN