Mac terminal proxy

配置 Terminal(终端)使用 Clash 作为网络代理
在 terminal 分别输入如下 2 个命令:

> export http_proxy=http://localhost:7890
> export https_proxy=http://localhost:7890
测试结果:可成功从控制台访问 Google

➜  ~ curl https://www.google.com/
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:7890
➜  ~ export http_proxy=http://localhost:7890
➜  ~ export https_proxy=http://localhost:7890
➜  ~ curl https://www.google.com/
<!doctype html><html itemscope="" itemtype....




如何取消终端中的配置
在 terminal 分别输入如下 2 个命令:

> unset http_proxy
> unset https_proxy
This entry was posted in 默认分类. Bookmark the permalink.