本地主机工作 127.0.0.1 在 Safari 中损坏

发布于 2024-08-13 22:12:47 字数 551 浏览 2 评论 0原文

我在运行 OSX 10.5.8 的 Mac Powerbook G4 上的非标准端口上运行 http 服务器,并尝试在 Safari 4.0.4 中打开页面。当我在 url 中使用 IP 地址 127.0.0.1 时,Safari 显示错误:

Safari 无法打开页面“http://12.34.56.78/”,因为该页面所在的服务器所在页面没有响应

如果 IP 地址是机器的外部 IP,则 Safari ,因此 Safari 会以某种方式将 127.0.0.1 转换为我面向互联网的 IP。当我在 URL 中使用别名“localhost”时,它会按预期工作并显示页面。

/etc/hosts 文件如下:

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 

你知道这里可能发生什么吗?

I'm running an http server on a non-standard port on a Mac Powerbook G4 running OSX 10.5.8 and attempting to open a page in Safari 4.0.4. When I use the IP address 127.0.0.1 in the url Safari shows an error:

Safari can’t open the page “http://12.34.56.78/” because the server where this page is located isn’t responding

where the IP address is the external IP of the machine, so somehow Safari translates 127.0.0.1 to my internet-facing IP. When I use the alias 'localhost' in the URL it works as expected and shows the page.

The /etc/hosts file is as follows:

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 

Any ideas what might be happening here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空袭的梦i 2024-08-20 22:12:47

此超级用户问题的答案建议禁用IPv6 等。

This SuperUser question has answers that suggest disabling IPv6, among other things.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文