I’m having a heck of a time getting my Cordova app to connect to its server under. I keep getting the following error in the Safari inspector no matter what my security policy is:
[Error] XMLHttpRequest cannot load http://testapp.musiquiz.com/sockjs/info?cb=[nonce]. Cross-origin redirection denied by Cross-Origin Resource Sharing policy.
Meteor is at the most current version and the boilerplate generator is working as per the fix in issue 7772.
I have the browser-policy package installed and have the following loading on startup on the server side:
Meteor.startup(function () {
BrowserPolicy.content.allowSameOriginForAll();
BrowserPolicy.content.allowOriginForAll('http://meteor.local');
BrowserPolicy.content.allowOriginForAll('http://localhost');
BrowserPolicy.content.allowOriginForAll('http://testapp.musiquiz.com');
BrowserPolicy.content.allowOriginForAll('https://testapp.musiquiz.com');
BrowserPolicy.content.allowOriginForAll('http://appv2.musiquiz.com');
BrowserPolicy.content.allowOriginForAll('https://appv2.musiquiz.com');
BrowserPolicy.content.allowEval();
});
I have the following app access rules in mobile-config.js and have confirmed that they are populating in the Cordova config.xml correctly:
App.accessRule('http://testapp.musiquiz.com/');
App.accessRule('https://testapp.musiquiz.com/');
App.accessRule('http://appv2.musiquiz.com/');
App.accessRule('https://appv2.musiquiz.com/');
I’m using the most current version of mup with an autogenerated letsencrypt cert. When I connect to the app via a web browser, the connection upgrades automatically. Interestingly, though the app URL in the mup.js file is configured as https, the app is trying to connect over http.
Here’s the mup.js file:
[code]module.exports = {
servers: {
one: {
host: ‘***.**..’,
username: '’,
pem: ‘************’
}
},
meteor: {
docker: {
image: ‘abernix/meteord:base’
},
name: ‘MusiQuiz’,
path: ‘/Users/adrianquince/Feedbaq/MusiQuiz’,
servers: {
one: {}
},
buildOptions: {
serverOnly: true,
server: ‘https://testapp.musiquiz.com’
},
env: {
PORT: 3000,
ROOT_URL: ‘https://testapp.musiquiz.com’,
MONGO_URL: ‘mongodb://localhost/meteor’
},
ssl: {
// Enables let’s encrypt (optional)
autogenerate: {
email: ‘@.**’,
domains: ‘testapp.musiquiz.com’ // comma seperated list of domains
}
},
deployCheckWaitTime: 240,
enableUploadProgressBar: true
},
mongo: {
oplog: false,
port: 27017,
servers: {
one: {},
},
},
};[/code]
Anyone have any ideas?