系统代理配置

cmd 代理

1
2
3
4
5
6
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080

# 恢复
set http_proxy=
set https_proxy=

unix 代理

1
2
3
# unix 下命令为 export
export http_proxy=http://127.0.0.1:1080
export https_proxy=http://127.0.0.1:1080

wsl2 代理

  1. 安装 Docker Desktop for Windows
  2. WSL2 backend
1
2
export http_proxy=http://host.docker.internal:1080
export https_proxy=http://host.docker.internal:1080

git ssh 代理

1
2
3
4
5
6
# 在 /{USER}/.ssh/ 目录下新建 config 文件, 内容如下:

Host gitlab.com
HostName gitlab.com
User git
ProxyCommand connect -S 127.0.0.1:1080 %h %p

vscode 代理

1
2
# User Settings 里设置
"http.proxy": "http://127.0.0.1:1080"