简体   繁体   中英

AirWatch, Hybrid App, iOS and VPN tunnel

We have the following configuration:

  • An iOS phone in the world wide web with AirWatch VPN installed.
  • A Cordova app trying to connect to an intranet server.
  • The AirWatch server is configured to tunnel the app's traffic (Per-App VPN), and while the cordova app is open, the VPN usage is indicated in the status bar.

However, the app cannot get data from the intranet server. The response to the request is

  • status 0
  • message undefined
  • responseText falsy

When using AirWatch browser to connect to the same URL (using VPN), it works. When using Safari (not using VPN), no connection to the server is possible.

In an all-intranet setting without AirWatch VPN, the app works as expected.

Now, I think Cordova uses a builtin Safari web browser. Is it possible that the request is not tunneled through VPN, although the app itself is VPN-enabled?

Cordova uses Whitelist plugin to enable http calls from the WebView. In the config.xml file you should have lines like those

<allow-navigation href="https://slack.cordova.io" />
<allow-navigation href="http://www.google-analytics.com/" />
<allow-navigation href="https://*.imgur.com/" />
<allow-navigation href="https://*.twitter.com/" />
<allow-navigation href="https://*.twimg.com/" />
<allow-navigation href="http://cordovablogs.discus.com/" />

Try adding the tag allow-navigation with the URL's you want to call from within the cordova application

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM