终端配置Qv2ray代理

配置完Qv2ray后,浏览器等可以使用代理。但是终端无法使用代理,比如git下载仓库。

打开Qv2ray配置

settings

https端口使用的是8889

Git

设置Http代理,永久生效

1
git config --global https.proxy https://127.0.0.1:8889

取消代理

1
git config --global --unset https.proxy

Windows

Powershell

1
$env:HTTPS_PROXY="http://127.0.0.1:8889"

cmd

设置代理,窗口关闭后失效

1
set https_proxy=http://127.0.0.1:8889

Linux

1
export https_proxy=localhost:8889

临时使用的话就直接在终端输入

永久配置的话把配置添加到~/.bashrc


终端配置Qv2ray代理
https://feater.top/linux/how-to-setup-system-proxy-in-terminal/
作者
JackeyLea
发布于
2023年11月14日
许可协议