I am ridiculously trying to get CORS working on Meteor 1.8, suddenly had this problem in my app:
" I chromium: [INFO:CONSOLE(0)] "Access to XMLHttpRequest at 'http://192.168.1.14/sockjs/info?cb=3lc2_ftamu' from origin 'http://localhost:12368' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.", source: http://localhost:12368/ (0)"
It only appears on Android and iOS, not when running web-only.
I searched all the stack overflow and Meteor help and forums, tried:
WebApp.rawConnectHandlers.use(function(req, res, next) {
res.setHeader("Access-Control-Allow-Origin", "*");
return next();
});
Also tried in mobile_config.js:
App.accessRule('*');
I also tried other headers on the server, updated Meteor, tried with the cors package:
...
WebApp.connectHandlers.use(cors(corsOptions));
and all the other common things when Meteor Cordova isn't running.
Any idea?