[英]Can't access 127.0.0.1
I can't figure out when this started to happen, but the result is - 127.0.0.1 is not working on any port from anywhere (for example, browser says Unable to connect).我不知道这是什么时候开始发生的,但结果是 - 127.0.0.1 无法在任何地方的任何端口上工作(例如,浏览器显示无法连接)。 Here are the results of my research:
以下是我的研究结果:
What else can I do to identify the source of problem and fix it?我还能做些什么来确定问题的根源并解决它?
UPDATE: as soon as Redis does work on 127.0.0.1 and both IIS and AzureStorageEmulator don't work I assume this is HTTP only issue.更新:一旦 Redis 在 127.0.0.1 上工作并且 IIS 和 AzureStorageEmulator 都不起作用,我认为这是 HTTP 唯一的问题。
Just one command did the work 只有一个命令完成了工作
netsh http add iplisten 127.0.0.1
netsh http添加iplisten 127.0.0.1
If it's a DNS problem, you could try: 如果是DNS问题,则可以尝试:
If this doesn't fix it, you could try editing the hosts file located here: 如果仍不能解决问题,则可以尝试编辑位于此处的hosts文件:
C:\Windows\System32\drivers\etc\hosts
And ensure that this line (and no other line referencing localhost) is in there: 并确保该行(并且没有其他引用localhost的行)在其中:
127.0.0.1 localhost
In windows first check under services if world wide web publishing services is running. 在Windows中,首先在服务下检查是否正在运行万维网发布服务。 If not start it.
如果没有启动。
If you cannot find it switch on IIS features of windows: In 7,8,10 it is under control panel , "turn windows features on or off". 如果找不到它,请打开Windows的IIS功能:在7,8,10中,它位于控制面板下,“打开或关闭Windows功能”。 Internet Information Services World Wide web services and Internet information Services Hostable Core are required.
Internet信息服务需要万维网服务和Internet信息服务Hostable Core。 Not sure if there is another way to get it going on windows, but this worked for me for all browsers.
不知道是否还有其他方法可以在Windows上运行它,但这对所有浏览器都有效。 You might need to add localhost or http:/127.0.0.1 to the trusted websites also under IE settings.
您可能还需要在IE设置下将localhost或http:/127.0.0.1添加到受信任的网站。
I had a similar issue.我有一个类似的问题。 Check your listen port.
检查您的侦听端口。 A mistake I made ealier was
我更早犯的一个错误是
app.listen(() => console.log(APP_NAME} is listening on port ${PORT}`))
Make sure you include the port as shown below确保包含如下所示的端口
app.listen(PORT, () =>{
console.log(`${APP_NAME} is listening on port ${PORT}`)
})
This answer may seem overly obvious, but in most cases it is sufficient to simply remove the "localhost" entry in the "Host Name" field:这个答案可能看起来过于明显,但在大多数情况下,只需删除“主机名”字段中的“localhost”条目就足够了:
In the end for us, it was IE11 that was blocking for 127.0.0.1 - after adding it to the exceptions list, it loaded the page.最后对我们来说,是 IE11 阻止了 127.0.0.1 - 在将其添加到例外列表后,它加载了页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.