Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这些行之间有什么区别:
::1 localhost
...和
127.0.0.1 localhost
在 Windows 主机文件中?
最初,我的 hosts 文件中有第一行,然后在浏览器中输入localhost将我带到127.0.0.1。然后我有一段时间没有在浏览器中使用 localhost 提示符,当我需要再次使用它时,它就不起作用了。我在我的主机文件中将第一行从第二行更改为有效。为什么会这样?
::1 是 IPv6。
127.0.0.1 是 IPv4。
::1 是IPv6
127.0.0.1 是IPv4
我猜你在测试之间禁用了 IPv6?
前者“::1”是 localhost 的 IPv6 压缩语法。它相当于 127.0.0.1。您是否在操作系统或网络适配器中禁用了 IPv6 支持?也许这就是它停止工作的原因。
我相信 ::1 是 127.0.0.1 的 IPV6 表示法。