How do you solve problems with CORS when using a web socket? | Sololearn: Learn to code for FREE!

+3

How do you solve problems with CORS when using a web socket?

Client and server are deployed in different domains. On the client, I have to receive real-time data coming from the server. For this I use a web socket, namely the library Socket.io

7/27/2019 4:43:59 PM

Uncle Basil

4 Answers

New Answer

+10

What page? The one i posted earlier? It working for me 🤔

+5

https://stackoverflow.com/questions/24058157/socket-io-node-js-cross-origin-request-blocked

+3

Burey I don't know why, that page is not opening. https://imgur.com/a/e5EwCZV

+1

Burey Thank you, I saw this article. However, in my case, none of the information in this article helped to solve the problem. And only by using a proxy on the server where I deployed the client, I solved it. Client (SPA) I deployed on Heroku with node.js. To the script that launches (executes) the application I added a middleware (http-proxy-middleware). However, I’m not sure if this is a good way, so I’m interested