http网页打开请求报错

220 阅读1分钟
报跨域错误:Access to XMLHttpRequest at 'http://localhost:xxxx/' from origin 'http://IP:Port' 
has been blocked by CORS policy...more-private address space `local`

网上的错误:谷歌浏览器遇到CORS错误 提示:Access to XMLHttpRequest at 'http://47.107.96.218:3205/'

from origin 'xxx.xx' has been blocked by CORS policy: The request client is not a

secure context and the resource is in more-private address space local. 升级了最新的谷歌浏览器出现了错误

报跨域错误,提示请求客户端不是安全上下文,资源位于更私有的“本地”地址空间中,不能访问local

原因:因为谷歌浏览器升级了,是谷歌浏览器又增加了访问限制导致的,应该是前几个月开始更新的, 解决方案就是使用https

解决

步骤1 : 谷歌浏览器 打开 chrome://flags/#block-insecure-private-network-requests

步骤2 : 找到 Block insecure private network requests. 设置为Disabled

步骤3 : 关闭谷歌浏览器重新打开网页 解决问题。