终端设置代理

macOS / Linux

假设代理主机为 127.0.0.1,HTTP 代理 / SOCKS5 代理监听端口为 7890

export http_proxy="http://127.0.0.1:7890" https_proxy="http://127.0.0.1:7890" all_proxy="socks5://127.0.0.1:7890" no_proxy="localhost,127.0.0.1,::1,.local"

最常用的设置是 https_proxy。如果你不想打太长的命令,可以只设置 https_proxy

Windows

PowerShell

$env:http_proxy="http://127.0.0.1:7890"; $Env:https_proxy="http://127.0.0.1:7890"; $Env:all_proxy="socks5://127.0.0.1:7890"; $Env:no_proxy="localhost,127.0.0.1,::1,.local"

CMD

set http_proxy="http://127.0.0.1:7890" & set https_proxy="http://127.0.0.1:7890" & set all_proxy="socks5://127.0.0.1:7890" & set no_proxy="localhost,127.0.0.1,::1,.local"
posted @ 2024-02-01 23:10  Undefined443  阅读(104)  评论(0)    收藏  举报