git
# socks5协议,v2ray默认监听10808端口
$ git config –global http.proxy socks5://127.0.0.1:10808
$ git config –global https.proxy socks5://127.0.0.1:10808
# http协议,v2ray默认监听10809端口
$ git config –global http.proxy http://127.0.0.1:10809
$ git config –global https.proxy https://127.0.0.1:10809
# 查看设置
$ git config -l
github
如果单独给github配置代理,设置如下:
# 走 socks5 代理
$ git config --global http.https://github.com.proxy "socks5://127.0.0.1:1080"
# 走 http 代理
$ git config --global http.https://github.com.proxy "http://127.0.0.1:10809"
# 取消设置
$ git config --global --unset http.https://github.com.proxy
npm
$ npm config set proxy http://127.0.0.1:10809
$ npm config set https-proxy http://127.0.0.1:10809
scoop
$ scoop config proxy 127.0.0.1:10809