Home Main Rails app cannot connect to secondary app when using USB-connected mobile Safari client
Reply: 0

Main Rails app cannot connect to secondary app when using USB-connected mobile Safari client

user1129
1#
user1129 Published in June 18, 2018, 5:23 pm

Got a main app running on port 3002 and a second one running on port 3000. When using the main app from a browser (tested Chrome, Firefox, Safari), everything works just fine, including mounting the second app in an iframe.

The problem I'm having is when I jump to debug the mobile version on my iPhone's Safari, the main app is failing to load the support app with error message 'Failed to load resource: Could not connect to the server.'

Both apps are Rails applications, with the secondary app running on a WEBrick HTTP Server. On the secondary app I added the following lines in application.rb to for CORS support, with no success:

    config.action_dispatch.default_headers.merge!({
      'Access-Control-Allow-Origin' => '*',
      'Access-Control-Request-Method' => '*'
    })

Another piece of the puzzle: when I switch the secondary app URL to the production one deployed in Heroku, the main app successfully loads it in the iFrame. So--issue is only happening when the secondary app is running locally.

Appreciate any pointers in advance.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.254401 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO