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

No 'Access-Control-Allow-Origin' header is present on the requested resource (socket.io) #1611

Closed
lwansbrough opened this issue Apr 19, 2014 · 6 comments

Comments

@lwansbrough
Copy link
Contributor

I've got a problem which is outlined here: socketio/socket.io-client#641

I've set the correct origins in config/sockets.js but the issue persists for that file alone. Seems to be a bug in socket.io - any workarounds?

@Samstiles
Copy link

what about the correct origins in config/cors.js?

@lwansbrough
Copy link
Contributor Author

They're the same (save for the delimiter).

@lwansbrough
Copy link
Contributor Author

My origins did not include the port number in config/sockets.js which solved it. The options in config/cors.js still have no effect, I have to set the Access-Control-Allow-Origin header in my middleware.

@adityapatadia
Copy link

https://github.com/theoctal/livenote/blob/master/app.js#L11 look here. The issue is essentially solved by setting middleware for express. This makes good example for those who want to know about how to set middleware.

@gCurtisCT
Copy link

@adityapatadia I tried that, and it didn't work.

@dcbartlett
Copy link
Contributor

@lwansbrough nailed it. CORS is port sensitive.

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

No branches or pull requests

5 participants