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

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

问题描述

我试图运行本地节点服务器,但无论出于何种原因 localhost:3000 都不起作用。错误页面显示该网页不可用ERR_CONNECTION_CLOSED 但是, 127.0.0.1:3000 确实有效。我试图更改我的主机文件,但无济于事。有谁知道是什么原因导致了这个问题?



Chrome版本为46.0.2490.80米

解决方案


  1. 编辑我的hosts文件,使<$ c $

  2. 清理我的Chrome缓存,特别是Cookie和缓存文件

  3. 清除 chrome:// net-internals /#dns
  4. 中的主机缓存
  5. 重新启动Chrome浏览器

另外,这也适用:


  1. 导航到chrome:// net-internals /#hsts

  2. 在删除域下,输入 localhost 并删除
  3. ol>

    我不知道,我的项目有一个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:

    1. Edited my hosts file so 127.0.0.1 localhost. was present, and saved the file
    2. Cleared my Chrome cache, specifically cookies and cached files
    3. Cleared host cache in chrome://net-internals/#dns
    4. Restarted chrome

    Alternatively, this also works:

    1. Navigate to chrome://net-internals/#hsts
    2. Under "Delete domain", type localhost and delete

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

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

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