在 Linux 中,可以设置 HTTP 代理和 HTTPS 代理的文件有:

  1. /etc/environment:在此文件中设置的代理将适用于整个系统。可以使用以下格式设置代理:

    http_proxy='http://proxy.example.com:8080/'
    https_proxy='http://proxy.example.com:8080/'
    
  2. /etc/profile:在此文件中设置的代理将适用于所有用户。可以使用以下格式设置代理:

    export http_proxy='http://proxy.example.com:8080/'
    export https_proxy='http://proxy.example.com:8080/'
    
  3. ~/.bashrc:在此文件中设置的代理将仅适用于当前用户。可以使用以下格式设置代理:

    export http_proxy='http://proxy.example.com:8080/'
    export https_proxy='http://proxy.example.com:8080/'
    
  4. ~/.bash_profile:在此文件中设置的代理将仅适用于当前用户。可以使用以下格式设置代理:

    export http_proxy='http://proxy.example.com:8080/'
    export https_proxy='http://proxy.example.com:8080/'
    

请注意,以上文件的路径可能因 Linux 发行版的不同而有所差异。在设置代理之后,需要重新启动终端或使用 source 命令使更改生效。

Linux HTTP 和 HTTPS 代理设置指南

原文地址: https://www.cveoy.top/t/topic/fNDD 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录