我无法连接到本地主机上的服务器

时间:2021-06-16 18:06:57

标签: javascript node.js

我在我的本地主机上运行一个 RESTful api 节点服务器,我可以通过邮递员访问它,但我无法在我的 React 应用程序上访问它并在尝试连接时出现此错误:

Android Navigation

有什么问题?

2 个答案:

答案 0 :(得分:1)

这篇文章中有一些关于受限/不安全端口的有趣信息:https://superuser.com/questions/188058/which-ports-are-considered-unsafe-by-chrome

以及如何在 https://superuser.com/questions/188006/how-to-fix-err-unsafe-port-error-on-chrome-when-browsing-to-unsafe-ports 上的 Windows 中关闭此设置

或者 - 将您暴露的端口更改为第一个链接上的列表之外。

答案 1 :(得分:1)

6000 被 Chrome 视为不安全端口。只需将端口 3000 或其他内容设置在安全范围内即可。

Ref