终端开启代理

即使开了全局模式终端也无法魔法上网,但我们往往需要在终端中使用git、curl,所以终端也必须开启代理。

windous

powershell

如果要使用curl,并且本地监听端口为10809
image
在命令行中输入该命令:

$env:http_proxy="http://127.0.0.1:10809"
$env:https_proxy="http://127.0.0.1:10809"

不需要时关闭:

$env:http_proxy=""
$env:https_proxy=""

git

设置:

git config --global http.proxy 'socks5://127.0.0.1:10808' 
git config --global https.proxy 'socks5://127.0.0.1:10808'

恢复:

git config --global --unset http.proxy
git config --global --unset https.proxy
posted @ 2024-03-08 16:35  seekwhale13  阅读(49)  评论(0)    收藏  举报