Node.js Heroku应用程序中Safari上阻止的socket.io CORS请求
我有一个React client+Express服务器,虽然该应用程序在Chrome和本地两种浏览器中都运行良好,但当部署到Heroku时,我在Safari中得到了以下信息:Node.js Heroku应用程序中Safari上阻止的socket.io CORS请求,node.js,heroku,safari,socket.io,cors,Node.js,Heroku,Safari,Socket.io,Cors,我有一个React client+Express服务器,虽然该应用程序在Chrome和本地两种浏览器中都运行良好,但当部署到Heroku时,我在Safari中得到了以下信息: [Warning] [blocked] The page at https://xxxxx.herokuapp.com/ was not allowed to display insecure content from http://localhost:5000/socket.io/?EIO=3&transport
[Warning] [blocked] The page at https://xxxxx.herokuapp.com/ was not allowed to display insecure content from http://localhost:5000/socket.io/?EIO=3&transport=polling&t=MLjfAYA.
XMLHttpRequest cannot load http://localhost:5000/socket.io/?EIO=3&transport=polling&t=MLjfTDz. Not allowed to request resource
我尝试在服务器io.origins(['https://xxxxx.herokuapp.com“])
但这没用
客户端连接到localhostconst socket=io('http://localhost:5000)
我尝试将其更改为Heroku URL,但没有任何帮助。我在package.json中使用代理:
"proxy": "http://localhost:5000",