To configure the proxy by setting environment variables, one way is to configure it directly in the system settings (this will not be explained), and the other way is to temporarily set it through the set command when needed.
-
[Windows command line]
The environment variables that control the proxy are http_proxy, http_proxy_user, http_proxy_pass, which are not case sensitive, and represent the proxy address (should be in the form of http://ip :port), proxy user name, and proxy password. In general, only http_proxy needs to be configured. That is, the parameter format is roughly as follows.
#设置参数 set http_proxy=http://localhost:8080 set http_proxy_user=username set http_proxy_pass=password #删除参数 set http_proxy= set http_proxy_user= set http_proxy_pass=
In addition, the https_proxy environment variable can be configured after testing, which is used to configure the proxy of https. If it is not configured, the configuration of http_proxy will be used. Based on this, it can be inferred that there are parameters such as https_proxy_user.
[Linux command line]
The configurable environment variable names are http_proxy, https_proxy, ftp_proxy, no_proxy, which are the addresses for configuring http proxy, https proxy, ftp proxy, and no proxy. The parameter format is roughly as follows (the correctness is to be investigated, and http may be added :// prefix), no_proxy is more special.
http_proxy=192.168.10.91:3128 https_proxy=192.168.10.91:3128 ftp_proxy=192.168.10.91:3128 no_proxy="127.0.0.1, localhost, 172.26.*, 172.25.6.66, 192.168.*"
There are also two configuration methods under linux, one is to configure in the relevant system file, and the other is to temporarily set it through the export command, which will not be described in detail here.