Acces-Control-Allow-Origin with Grunt Server and Flask gevent-SocketIO-app

613 views
Skip to first unread message

Arnout Aertgeerts

unread,
Oct 16, 2013, 8:36:30 AM10/16/13
to gevent-...@googlegroups.com
I'm having trouble connecting to my gevent-socketIO server (Flask)
I keep getting the following error message: 

XMLHttpRequest cannot load http://localhost:8080/socket.io/1/?t=1381872821951. 
Origin http://localhost:9000 is not allowed by Access-Control-Allow-Origin.
Is this a problem of the socketIO server or a problem of the grunt server? I am running an angular-app using grunt.

This is the question on StackOverflow

Thanks in advance! (I really could need some help)

Alexandre Bourget

unread,
Oct 16, 2013, 8:52:53 AM10/16/13
to gevent-...@googlegroups.com
Normally, there are provisions in the gevent-socketio to send the CORS headers for cross-domain requests.. sometimes, if there is a crash somewhere in the request, the framework replies with an empty (no CORS headers) Not Found, or Bad Request or something like that.  In that case, the front-end sees that reply as not authorizing CORS requests.. but really it's just an error.

When using cross-origin requests, I try to send my errors back with Access-Control headers set.. so at least the error messages are complete and useful on the front-end.

Hope this gives you some clues

Alexandre


--
You received this message because you are subscribed to the Google Groups "gevent-socketio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gevent-socket...@googlegroups.com.
To post to this group, send email to gevent-...@googlegroups.com.
Visit this group at http://groups.google.com/group/gevent-socketio.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages