socket.io CORS requests blocked on Safari in Heroku app

Viewed 304

I have a React client + Express server and while the app works fine in Chrome and locally in both browsers, when deployed to Heroku I get this in 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=polling&t=MLjfAYA.

XMLHttpRequest cannot load http://localhost:5000/socket.io/?EIO=3&transport=polling&t=MLjfTDz. Not allowed to request resource

I tried using this on the server io.origins(['https://xxxxx.herokuapp.com']) but it didn't help.

The client connects to localhost const socket = io('http://localhost:5000') I tried changing it to the Heroku URL and it didn't help. I use proxy in package.json:

"proxy": "http://localhost:5000",
0 Answers
Related