Problems running deployed app

Hello,

So I deployed a testing app using:

$ meteor deploy ditiseentest.meteor.com

Now, I want to run using my Samsung Galaxy S4.
As the tutorial says, I use:

$ meteor run android-device --mobile-server ditiseentest.meteor.com

The terminal answered the following:

=> Started proxy. => Started MongoDB.

WARNING: You are testing your app on a remote device. For the mobile app to be
able to connect to the local server, make sure your device is on the
same network, and that the network configuration allows clients to
talk to each other (no client isolation).
=> Started your app.

=> App running at: http://localhost:3000/
=> Started app on Android Device.

First of all, this is strange, because it shouldn’t run at localhost:3000, but at ditiseentest.meteor.com (if im correct).

Second of all, I get these errors:

I20151021-11:15:44.013(2) (android:http://meteor.local/:0) XMLHttpRequest cannot load http://192.168.0.110:3000/sockjs/info?cb=3ywg25gap2. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://meteor.local’ is therefore not allowed access.
I20151021-11:15:56.008(2) (android:http://meteor.local/:0) XMLHttpRequest cannot load http:// 192.168.0.110:3000/sockjs/info?cb=z59il3_9xv. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://meteor.local’ is therefore not allowed access.
I20151021-11:16:14.525(2) (android:http://meteor.local/:0) XMLHttpRequest cannot load http:// 192.168.0.110:3000/sockjs/info?cb=nrl4kdfs_l. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://meteor.local’ is therefore not allowed access.

(At the last two errors I removed the hyperlink, since I can only use two links in a post)

Does anyone know what causes this problem, and is it possible to deploy my app to some of Meteors servers, and run it remotely with my phone?

Thanks!

The “localhost” server starts automatically with it. With –mobile-server ditiseentest.meteor.com you connect your app with your deployment version. You can give it a try: Change a file on your local dev machine - as you can see, there will be no hot-code push on your phone, because your app is connected with your deployment server.

The last error seems to be a cross origin error, your app can’t load sources from other hosts. You can try to add this line to your mobile-config.js:

App.accessRule(’*’);

If this also not works, your “sockjs” server has to send a header with
Access-Control-Allow-Origin: “*”

This allows third party sites to load content from your host - but it can also be a security risk.

1 Like

Thanks a lot!

Adding App.accessRule(’*’); to my mobile-config.js file solved the errors!