在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命令使更改生效。


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

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