In general you can’t. ping needs a direct network connection on the IP
level to do its work. A proxy works on a higher layer of the TCP/IP
network model, where there is no direct access to the IP protocol.

You would need to somehow circumvent the proxy (change firewall
settings, use a VPN, …). Whether this is possible (and allowed)
depends on your network configuration, but it’s probably not possible.

As a workaround, there are many web-based ping services available
(search for “web-based ping”). These will work.

简单的说就是 ping 命令需要直接网络,不能使用代理,所以每一次ping google 的时候,都是 timeout

作为替代的方法,可以使用基于 web 的 ping 工具

在这里我使用 wget 就能访问

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐