live site issue
sachin54550 opened this issue · 2 comments
sachin54550 commented
pradeepkumar28 commented
I am having same problem but my console is showing "Access to XMLHttpRequest at 'https://ch4t-it.herokuapp.com/socket.io/?EIO=4&transport=polling&t=NR9OV9U' from origin 'https://chat-n-chat.netlify.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."
Beefy-py commented
You solve that by initiating io like so
const io = socketIo(httpServer, {
cors: {
origin: "*",
methods: ["GET", "POST"],
credentials: true,
},
});
In your index.js file.