Window和Linux设置代理和取消代理(http_proxy)

前言

需要git clone下载项目的时候,一直clone不下来,则需要添加代理

特别注意,在图形界面中设置代理之后,还需要在终端命令行中设置,否则终端无法使用

1. Window

临时设置代理:

export http_proxy=http://ip:端口号
export https_proxy=https://ip:端口号

截图如下:(需要注意,打开代理之后 查看自身的ip以及端口号)
在这里插入图片描述

临时取消代理:

unset http_proxy

unset https_proxy

2. Linux

和Window设置的命令有所不同

set http_proxy=http://ip:端口号 
set https_proxy=http://ip:端口号

具体如下:

set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890

猜你喜欢

转载自blog.csdn.net/weixin_47872288/article/details/135049570
今日推荐