Edit the ~/.bash_profile file, or create one

If the terminal is ZSH, edit ~/.zshrc

Set the HTTP and HTTPS proxy

Function proxy_on() {export http_proxy=http://127.0.0.1:7890; Export https_proxy = http://127.0.0.1:7890; Export no_proxy = localhost, 127.0.0.1, localaddress, localdomain.com; } function proxy_off() {unset http_proxy; unset https_proxy; unset no_proxy; } function proxy_status() {echo $https_proxy curl cip}Copy the code

Other Proxy Settings

Export ftp_proxy=socks5://127.0.0.1:7890; Export rsync_proxy=socks5://127.0.0.1:7890; Export all_proxy=socks5://127.0.0.1:7890;Copy the code

Start the broker

proxy_on
Copy the code

Close the agent

proxy_off
Copy the code

Test whether the agent is in effect

curl ip.sb
proxy_status
Copy the code