Set proxy in Linux

less than 1 minute read

Set-proxy-in-Linux

将下面的命令添加到~/.bashrc中,然后source ~/.bashrc

proxy () {
  export ALL_PROXY="socks5://127.0.0.1:7890"
  export all_proxy="socks5://127.0.0.1:7890"
  curl -H "User-Agent:XXX" ip.cn
}

noproxy () {
  unset ALL_PROXY
  unset all_proxy
  curl -H "User-Agent:XXX" ip.cn
}

Tags:

Categories:

Updated:

Comments