Windows / Linux 下为 命令行 设置临时代理

Linux 下 使用 export http_proxy export https_proxy 环境变量 为 命令行 设置临时代理

export http_proxy=http://127.0.0.1:1080
export https_proxy=http://127.0.0.1:1080

Windows 下 使用 set http_proxy set https_proxy 环境变量 为 命令行 设置临时代理

set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080

 注意:如果 代理服务器 的协议 使用的是 套接字,则需要将上述代码中 http 和 https 协议 替换为:socks5 

例如:

# Linux 下
export http_proxy=socks5://127.0.0.1:1080
export https_proxy=socks5://127.0.0.1:1080

# Windows 下
set http_proxy=socks5://127.0.0.1:1080
set https_proxy=socks5://127.0.0.1:1080

自此便设置完成

猜你喜欢

转载自blog.csdn.net/weixin_45956258/article/details/120423310
今日推荐