macOS:设置上网代理

此文章发布于 26 个月前,部分信息可能已经过时,请自行斟酌确认。

这里总结 3 种在 macOS 系统上设置上网代理的方法。

方法1:

临时生效,直接在终端运行:

export http_proxy="http://127.0.0.1:1080"
export https_proxy="http://127.0.0.1:1080"

方法2:

把代理服务器地址写入 shell 配置文件 .bashrc 或者 .zshrc
然后刷新配置:source ~/.bashrc

方法3:

改相应工具的配置,比如 apt 的配置

sudo vim /etc/apt/apt.conf

在文件末尾加入下面这行:

Acquire::http::Proxy "http://proxyAddress:port"
最后修改:2022 年 02 月 25 日 02 : 55 PM
如果觉得我的文章对你有用,请随意赞赏

发表评论