Web Development

/ 换个头像心好累 / 0评 / 1/ 最后更新:2023-05-12
shell终端使用代理

需求场景

有时候下载部分软件,需要使用代理,比如homebrew,所以需要终端网络走代理。

解决方案

 alias setproxy="export ALL_PROXY=socks5://127.0.0.1:1080" 
 alias unsetproxy="unset ALL_PROXY"

Windows 终端

set HTTPS_PROXY=http://127.0.0.1:10808
set HTTP_PROXY=http://127.0.0.1:10809

set HTTPS_PROXY=
set HTTP_PROXY=

Windows WSL2解决方案

 cat /etc/resolv.conf|grep nameserver|awk '{print $2}'
 alias setproxy="export ALL_PROXY=socks5://172.21.160.1:10808" 
 alias unsetproxy="unset ALL_PROXY"

1

Leave a Reply

Your email address will not be published. Required fields are marked *