Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

live site issue #32

Open
sachin54550 opened this issue Dec 27, 2020 · 2 comments
Open

live site issue #32

sachin54550 opened this issue Dec 27, 2020 · 2 comments

Comments

@sachin54550
Copy link

Screenshot (322)
The server is working fine and there's no error showing but still messages are not sending. it's working fine on localhost though

@pradeepkumar28
Copy link

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
Copy link

Beefy-py commented Mar 6, 2022

You solve that by initiating io like so

const io = socketIo(httpServer, {
  cors: {
    origin: "*",
    methods: ["GET", "POST"],
    credentials: true,
  },
});

In your index.js file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants