终端设置代理

cmd

set http_proxy=http://127.0.0.1:10811

set https_proxy=http://127.0.0.1:10811

  

 

bash

function on_proxy() {
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    export https_proxy=http://127.0.0.1:10811 http_proxy=http://127.0.0.1:10811 all_proxy=socks5://127.0.0.1:10810
    echo -e "\033[32m代理已开启\033[0m"
}

function off_proxy(){
    unset http_proxy
    unset https_proxy
    unset all_proxy
    echo -e "\033[31m代理已关闭\033[0m"
}

 

命令行中直接运行,仅当前命令行有效,注意修改代理端口号

 export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
 export https_proxy=http://127.0.0.1:10811 http_proxy=http://127.0.0.1:10811 all_proxy=socks5://127.0.0.1:10810

  

 

posted on 2023-01-23 15:49  lxxd  阅读(134)  评论(0)    收藏  举报

导航