对于代理问题的解决方案

  1. Windows本地Https访问问题或者是非Http协议无法走代理的问题:
    使用sock代理的形式进行TCP的代理
  2. WSL2中需要使用代理, 使用DNS服务地址获取主机IP
    host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
    export http_proxy="http://$host_ip:port"
    export https_proxy="http://$host_ip:port"
    
  3. Docker中需要使用代理, 需要手动写入主机IP, 其访问的DNS服务不是主机地址
    export http_proxy="http://host_ip:port"
    export https_proxy="http://host_ip:port"
    
posted @ 2023-08-05 21:39  NoobSir  阅读(17)  评论(0编辑  收藏  举报