• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ha2ha
V2EX  ›  程序员

挂了代理, clone 速度很快,但是 ping 不通

  •  
  •   ha2ha · Aug 24, 2022 · 4914 views
    This topic created in 1542 days ago, the information mentioned may be changed or developed.
    - 设置代理之后,ping 不通,但是 clone 变快了,git push origin main 直接无响应
    - 网上很多方法都尝试了,依然无解
    - 求助一下大佬
    17 replies  •  2022-08-25 09:44:56 +08:00
    newboy1
    newboy1
    Aug 24, 2022
    1
    ping 不通是正常的,一般很少有代理 icmp
    Coder89757
    Coder89757
    Aug 24, 2022
    2
    ```bash
    # 终端全局开启和关闭代理(端口啥的自己改下)
    alias goproxy='echo "Http(s) proxy ON!😆"; export ALL_PROXY="socks5://127.0.0.1:58001"; export http_proxy="http://127.0.0.1:58002"; export HTTP_PROXY="http://127.0.0.1:58002"; export https_proxy="http://127.0.0.1:58002"; export HTTPS_PROXY="http://127.0.0.1:58002"'

    alias deproxy='echo "Http(s) proxy OFF😔"; unset ALL_PROXY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY'
    ```
    DawnMoon
    DawnMoon
    Aug 24, 2022
    3
    你看下你是什么代理,如果是 http 代理的话,不支持 ssh 方式传输的
    Coder89757
    Coder89757
    Aug 24, 2022
    4
    另外 git 本身是走 SSL 进行推拉的,试着通过 git config 强制降级为通过 https ,这样就可以走代理了
    q474818917
    q474818917
    Aug 24, 2022
    5
    一个 tcp ,一个 icmp 完全不同啊
    Coder89757
    Coder89757
    Aug 24, 2022
    6
    git config --global url."https://".insteadOf git://
    zliea
    zliea
    Aug 24, 2022
    7
    可以用 tcping
    deng1xia
    deng1xia
    Aug 24, 2022
    8
    用 clash 的 tun 模式呗,所有流量都会走它,包括终端
    ha2ha
    ha2ha
    OP
    Aug 24, 2022
    9
    @Coder89757 git config --global http.proxy 'http://127.0.0.1:7890'
    git config --global https.proxy 'http://127.0.0.1:7890'我是这样设置的代理的,强制降级为通过 https ,有点没明白
    ha2ha
    ha2ha
    OP
    Aug 24, 2022
    10
    @yuhuazhu 我只看到了 global ,Rule,等等 4 个模式,没太懂 tun 模式,求解
    ha2ha
    ha2ha
    OP
    Aug 24, 2022
    11
    @yuhuazhu 感谢大佬指点,网上有 tun 教程,感谢
    @Coder89757
    dcsuibian
    dcsuibian
    Aug 24, 2022 via Android
    12
    ss 不是 vpn ,是应用层代理。
    ping 是 icmp 协议,在网络架构中处于饺低
    的 ip 层。一般管不了。
    另外是需要在命令行中设置 http_proxy 和 https_proxy 环境变量。设置完后应该自动就会走了。
    最靠谱的方法是看日志
    HugoChao
    HugoChao
    Aug 24, 2022
    13
    github 一直是 ping 不通的 用起来正常
    fitme
    fitme
    Aug 24, 2022
    14
    ping 不通很模糊,别人有可能禁 ping 呀,
    Tink
    Tink
    Aug 24, 2022 via Android
    15
    ping 是 icmp
    snoopygao
    snoopygao
    Aug 25, 2022
    16
    tcp over tcp 和 all over tcp 的区别
    nothingistrue
    nothingistrue
    Aug 25, 2022
    17
    @ha2ha #9 http.proxy 跟 https.proxy 没有区别的,git 只看后面地址的协议部分。http 代理是应用层且无加密的代理,限制非常大,基本没法用。要换成会话层的 Socks 代理才行,不过即使这样,有些安全性的东西,比如说令牌登录,也用不了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2336 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 03:25 · PVG 11:25 · LAX 19:25 · JFK 22:25
    ♥ Do have faith in what you're doing.