meteor run android-device --mobile-server http://myapp.com --production --verbose
I never get connected (the dreaded “connecting”…“waiting” in Meteor.status), and the verbose output gives:
XMLHttpRequest cannot load http://myapp.com/sockjs/info?cb=bgnptnrcqn. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://meteor.local' is therefore not allowed access.
Several hours of googling similar problems hasn’t led me to any solution (not to mention I’ve been trying to get this working for days). Anybody have any ideas? I’m building on Ubuntu 14.04, running Android 4.4 Samsung Galaxy Prevail, and my server (DigitalOcean droplet) is using nginx proxy, nginx 1.8.0.
I am deploying with mup, and this environment setup currently:
"env": {
"DDP_DEFAULT_CONNECTION_URL": "http://myapp.com",
"ROOT_URL": "http://myapp.com",
"MONGO_URL": "mongodb://localhost:27017/meteor",
"UPSTART_UID": "mylinuxuser" // The user you want to run meteor as.
},
I finally got this connected, but I’ve tried so many variations that I want to be clear myself on what exactly finally did work (because of the time it takes to re-deploy and re-launch the app I wasn’t always perfect about only changing one thing at a time) and for that I will have to return to this later.
Sorry I have not yet gotten to SSL for my project and I’m still not entirely sure what I gave days out of my life to, but one of the last things I did was remove the UPSTART_UID bit that I found suggested somewhere.
The --mobile-server flag tripped me up, it’s --server when meteor build-ing
meter help run and meteor help build seemed inconsistent, until I read the whole paragraph description for --mobile-server and --server respectively.
Managed to get the SSL config to work with mup; same config fails for unknown reasons with mupx (active development). To get it working, it’s mostly making sure the keys are concatenated in the right order as per @arunoda’s instructions
I’ve never tried the “meteor build” before. I thought that was only for people who are not using mup??
[edit] I did finally get connected. There were a great many snags and it cost no small amount of the weekend to overcome them all. A good blog post and/or thorough documentation on these things is warranted. I’ll try to do my part. One of the final pieces for me was Slava Kim’s post about the browser-policy package: https://github.com/meteor/meteor/issues/4132