curl仅在我的计算机上从服务器返回“空回复”时排除连接问题

无论什么原因,当我的电脑(Mac OS X 10.11.1)在其他电脑上正常工作时,无法使用curl从网站获取网页。 平也工作,但curl不:

$ ping www.latex-tutorial.com PING latex-tutorial.com (162.252.172.25): 56 data bytes 64 bytes from 162.252.172.25: icmp_seq=0 ttl=54 time=76.116 ms 64 bytes from 162.252.172.25: icmp_seq=1 ttl=54 time=74.538 ms 64 bytes from 162.252.172.25: icmp_seq=2 ttl=54 time=90.379 ms ^C --- latex-tutorial.com ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 74.538/80.344/90.379/7.125 ms 

现在当有问题的机器几次执行curl时:

 $ curl http://www.latex-tutorial.com curl: (52) Empty reply from server $ curl -Lv http://www.latex-tutorial.com * Rebuilt URL to: http://www.latex-tutorial.com/ * Trying 2a02:748:a800:162:252:172:25::... * Connected to www.latex-tutorial.com (::1) port 80 (#0) > GET / HTTP/1.1 > Host: www.latex-tutorial.com > User-Agent: curl/7.43.0 > Accept: */* > * Empty reply from server * Connection #0 to host www.latex-tutorial.com left intact curl: (52) Empty reply from server 

当我在同一个networking的不同的Mac笔记本电脑(相同版本)上执行相同的命令,我每次都得到一个正确的HTML网页。 我的机器可能有什么问题? 我从互联网上下载了一些东西,我的机器可能已经感染了病毒/恶意软件,但我的防病毒程序无法检测到任何东西。

任何人都可以指向我应该开始寻找错误的地方吗?

尝试将-4选项添加到curl命令行。 或者,尝试http://162.252.172.25 ,看看你得到什么。 ping使用该地址,这是一个IPv4地址。 curl使用IPv6,地址以2a02 。 并不是所有的IPv6协议栈都同样健壮 – 也许你的连接问题。