Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome Chrome现在将localhost的IP地址与somesite.localhost相同_Google Chrome_Iis_Localhost_Vagrant_Hosts - Fatal编程技术网

Google chrome Chrome现在将localhost的IP地址与somesite.localhost相同

Google chrome Chrome现在将localhost的IP地址与somesite.localhost相同,google-chrome,iis,localhost,vagrant,hosts,Google Chrome,Iis,Localhost,Vagrant,Hosts,有一段时间,我在Windows7操作系统上运行了两个不同的服务器环境。IIS在127.0.0.1上运行,我有一个使用192.168.33.10的Vagrant VM。我的主机文件看起来像: vagrantsite1.localhost 192.168.33.10 vagrantsite2.localhost 192.168.33.10 iissite1.localhost 127.0.0.1 iissite2.localhost 127.0.0.1 直到大约一周前,这个设置工作得非常好,但是

有一段时间,我在Windows7操作系统上运行了两个不同的服务器环境。IIS在127.0.0.1上运行,我有一个使用192.168.33.10的Vagrant VM。我的主机文件看起来像:

  • vagrantsite1.localhost 192.168.33.10
  • vagrantsite2.localhost 192.168.33.10
  • iissite1.localhost 127.0.0.1
  • iissite2.localhost 127.0.0.1
直到大约一周前,这个设置工作得非常好,但是最近我的Chrome浏览器发生了一些变化。现在,在Chrome中,当我访问vagrantsite1.localhost时,它突然引用了IIS 127.0.0.1 IP地址,而不是192.168.33.10。我使用chrome://net-internals/#dns甚至清除了主机缓存,这似乎无法解决任何问题

经过一些研究,我发现如果我将localhost 192.168.33.10添加到我的hosts文件中,流浪网站可以工作,但是现在我的IIS网站尝试访问这个IP,而不是127.0.0.1。Chrome似乎不允许我为somesite.localhost条目使用不同的IP。这在IE和Firefox中都不是问题,直到最近,在Chrome中也不是问题

我想知道是否有其他人有这个问题或潜在的解决方案(而不是每次我想切换服务器时手动设置本地主机IP)?我意识到我可以为其中一台服务器使用不同的端口号作为解决方案,但是由于IE和Firefox中的一切都很好,直到最近Chrome中的一切都很好,我想知道原因。

这是Chrome中刚刚添加的一项“功能”,所有本地主机域都将始终解析为环回

有关详细信息,请参阅以下链接:


一种解决方法是将条目更改为不以localhost结尾,类似“vagrantsite1.local 192.168.33.10”的内容应该会起作用。

ping vagrantsite1.localhost时IP显示了什么?如果显示127.0.0.1,则当我ping vagrantsite1.localhost时可能是配置错误,我得到192.168.33.10。当我看铬合金的时候chrome://net-internals/#dns 清除主机缓存并访问vagrantsite1.localhost后,我看到localhost 127.0.0.1的新条目。就好像Chrome对vagrantsite1.localhost=localhost感到困惑,事实并非如此。如前所述,这只发生在Chrome中,Firefox和IE似乎正在解析正确的IP。谢谢你,当像这样的新“功能”被引入并最终造成严重破坏时,这是令人沮丧的。我更喜欢使用.localhost扩展,但现在将切换到本地。刚刚有了这个确切的实现时刻!谢谢你证实我的怀疑。名为client.localhost的开发服务器已停止工作。显示了各种不同的错误,但都是因为它们被解析到开发人员自己的机器上(在Chrome中)。