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://' alias unproxy='unset all_proxy'

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

% source ~/.zshrc


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_proxy= all_proxy=socks5://


% source ~/.zshrc