Toggle proxy env variables (http_proxy
, https_proxy
and no_proxy
) in command line.
English | 简体中文
npm i -g proxy-cmd
Press Win + R
, input "cmd", then press Ctrl + Shift + Enter
, open cmd as administrator
# Init proxy-cmd
proxy init 'http://127.0.0.1:8234'
# Set proxy env variables in current terminal, should init first
# HTTP_PROXY=http://127.0.0.1:8234
# HTTPS_PROXY=http://127.0.0.1:8234
proxy-on
# Del proxy env variables in current terminal, should init first
proxy-off
# Set global proxy env variables, needs administrator privileges
# Needs restart the terminal after running this command!!!
# HTTP_PROXY=http://127.0.0.1:8234
# HTTPS_PROXY=http://127.0.0.1:8234
proxy set
# Del global proxy env variables, needs administrator privileges
# Needs restart the terminal after running this command!!!
proxy del
# Show proxy url
proxy url
# Change proxy url
proxy url 'http://127.0.0.1:7890'
# Show NO_PROXY config
proxy np
# Change NO_PROXY config
proxy np 'localhost,127.0.0.1'
# Delete NO_PROXY config
proxy np del
Run the following commands in terminal
# Init proxy-cmd
sudo proxy init 'http://127.0.0.1:8234'
# Set proxy env variables in current terminal, should init first
# http_proxy=http://127.0.0.1:8234
# https_proxy=http://127.0.0.1:8234
proxy-on
# Del proxy env variables in current terminal, should init first
proxy-off
# Set global proxy env variables
# Needs restart the terminal after running this command!!!
# http_proxy=http://127.0.0.1:8234
# https_proxy=http://127.0.0.1:8234
sudo proxy set
# Del global proxy env variables
# Needs restart the terminal after running this command!!!
sudo proxy del
# Show proxy url
sudo proxy url
# Change proxy url
sudo proxy url 'http://127.0.0.1:7890'
# Show no_proxy config
sudo proxy np
# Change no_proxy config
sudo proxy np 'localhost,127.0.0.1'
# Delete no_proxy config
sudo proxy np del