问题描述
我试图运行本地节点服务器,但无论出于何种原因 localhost:3000
都不起作用。错误页面显示该网页不可用ERR_CONNECTION_CLOSED
但是, 127.0.0.1:3000
确实有效。我试图更改我的主机文件,但无济于事。有谁知道是什么原因导致了这个问题?
Chrome版本为46.0.2490.80米
- 编辑我的hosts文件,使<$ c $
- 清理我的Chrome缓存,特别是Cookie和缓存文件
- 清除
chrome:// net-internals /#dns
中的主机缓存 - 重新启动Chrome浏览器
另外,这也适用:
- 导航到chrome:// net-internals /#hsts
- 在删除域下,输入
localhost
并删除
ol> - Edited my hosts file so
127.0.0.1 localhost.
was present, and saved the file - Cleared my Chrome cache, specifically cookies and cached files
- Cleared host cache in
chrome://net-internals/#dns
- Restarted chrome
- Navigate to chrome://net-internals/#hsts
- Under "Delete domain", type
localhost
and delete
我不知道,我的项目有一个HSTS中间件,它设置了一个HSTS cookie
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 version is 46.0.2490.80 m
Here are the steps I took to make this work correctly:
Alternatively, this also works:
Unbeknownst to me, my project had an HSTS middleware that set an HSTS cookie
这篇关于本地主机不能在Chrome中工作,127.0.0.1确实有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!