在 MacOS 操作系统中,默认情况下,终端命令行不会通过代理进行网络连接。这导致在应用软件研发过程中,许多需要通过命令行下载安装的软件或依赖包无法成功安装。经常出现Failed to connect to xxx port 443 after 75329 ms: Couldn't connect to server错误提醒。

如果您需要让 Mac终端命令行走代理,可以按照以下步骤进行设置:
一、配置bash_profile文件
- 首先:在当前用户根目录找到(新建)一个文件名为 .bash_profile 的文件,然后输入以下代码:
function proxy_off(){
        unset http_proxy
        unset https_proxy
        unset ftp_proxy
        unset rsync_proxy
        echo -e "已关闭代理"
}
 
function proxy_on() {
        export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
        export http_proxy="http://127.0.0.1:7890"
        export https_proxy=$http_proxy
        export ftp_proxy=$http_proxy
        export rsync_proxy=$http_proxy
        export HTTP_PROXY=$http_proxy
        export HTTPS_PROXY=$http_proxy
        export FTP_PROXY=$http_proxy
        export RSYNC_PROXY=$http_proxy
        echo -e "已开启代理"
}
函数中的 http_proxy="http://127.0.0.1:7890"就是你代理的端口和IP,比方说我用的代理,默认端口就是7890。
- 然后:
 当让终端走代理的时候,输入:source ~/.bash_profile proxy_on
 当想关闭代理的时候,输入:source ~/.bash_profile proxy_off
二、实操
首先,打开终端,输入:
source  ~/.bash_profile
proxy_on

然后,测试是否开启成功:
curl www.google.com

当安装相应软件后,关闭代理,输入:
source  ~/.bash_profile
proxy_off #或者直接关闭终端窗口



















![ORA-00600: internal error code, arguments: [krbcbp_9]](https://img-blog.csdnimg.cn/direct/676a4272d38943c0aae0d42cba8a3567.png)