本地主机在 Chrome 中不工作,127.0.0.1 工作 [英] Localhost not working in Chrome, 127.0.0.1 does work

查看:131
本文介绍了本地主机在 Chrome 中不工作,127.0.0.1 工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行本地节点服务器,但由于某种原因 localhost:3000 不起作用.错误页面指出 此网页不可用 ERR_CONNECTION_CLOSED 但是,127.0.0.1:3000 确实有效.我曾尝试更改我的主机文件,但无济于事.有谁知道是什么导致了这个问题?

I'm trying to run a local node server, but for whatever reason localhost:3000 does not work. The error page states This webpage is not available ERR_CONNECTION_CLOSED However, 127.0.0.1:3000 does work. I have tried making changes to my hosts file, but to no avail. Does anyone have any idea what's causing the problem?

Chrome 版本为 46.0.2490.80 m

Chrome version is 46.0.2490.80 m

推荐答案

以下是我为使其正常工作所采取的步骤:

Here are the steps I took to make this work correctly:

  1. 编辑了我的主机文件,所以 127.0.0.1 localhost. 存在,并保存了文件
  2. 清除了我的 Chrome 缓存,特别是 cookie 和缓存文件
  3. 已清除 chrome://net-internals/#dns
  4. 中的主机缓存
  5. 重启 chrome

或者,这也有效:

  1. 导航到 chrome://net-internals/#hsts
  2. 在删除域"下,输入 localhost 并删除

我不知道,我的项目有一个设置 HSTS cookie 的 HSTS 中间件

Unbeknownst to me, my project had an HSTS middleware that set an HSTS cookie

这篇关于本地主机在 Chrome 中不工作,127.0.0.1 工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆