关于npm:如何为你的命令行设置代理

如何在命令行里应用shadowsocks或者v2rayn的代理呢?

http

  • linux:
export http_proxy=http://127.0.0.1:1087;
export https_proxy=http://127.0.0.1:1087;
  • window:
set http_proxy=http://127.0.0.1:1087;
set https_proxy=http://127.0.0.1:1087;

socks(socks5)

  • linux:
export http_proxy=socks5://127.0.0.1:10808
export https_proxy=socks5://127.0.0.1:10808
  • window:
# 应用sock5代理
set http_proxy=socks5://127.0.0.1:10808
set https_proxy=socks5://127.0.0.1:10808

勾销代理

  • linux:
unset http_proxy
unset https_proxy
  • window:
set http_proxy=
set 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

附:

1.shadowsocks命令复制

2.v2rayn端口查看

3.通过主机IP代理

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理