Supporting Proxy PAC inside Mobile Apps

A proxy auto-config (PAC) file defines how web browsers and other user agents can automatically choose the appropriate proxy server (access method) for fetching a given URL.

This Knowledge Base article provides step-by-step instructions for adding support for Proxy PAC inside mobile apps, instantly, without coding on Appdome.

No Code Support for Proxy PAC inside Mobile Apps

The Appdome technology adds Proxy PAC support and relevant standards, frameworks and more to the app automatically, with no manual development work at all. Using Appdome, mobile apps will support proxy controlled by a PAC file as if it was natively coded to the app.  Using Appdome, there are no development or coding prerequisites. For example, there is no Appdome SDK, libraries, or plug-ins to implement. Likewise, there are no required infrastructure changes and no dependency on networking API inside the app.

Appdome allows you to configure your app to proxy with dynamic and static configuration. Static configuration is constant per app and will require fusing the app with the new configuration and deploying it again to adapt to any changes in proxy network topology. A dynamic configuration can be achieved by setting a WPAD URL, which is a path to a downloadable PAC file. The PAC file contains the proxy translation logic between the protected host and the proxy that should route connections to that host. When multiple proxy setup methods are used the following priority will be used to determine the host-proxy translation logic. Appdome will first try and download the PAC file from the downloadable URL if omitted or downloading the file fails then static configurations will be used. Within static configuration, the Dedicated proxy URL will take priority over the PAC file.

Adding support for Proxy PAC inside mobile apps does not require installing any VPN app or special configuration and doesn’t impact any other app installed on the device. Furthermore, supporting proxy PAC works with EMM tunneling and MicroVPN. These combinations will cover cases in which a proxy is required to access a protected host, however, the proxy itself is only accessible within the internal network.

Prerequisites for using Appdome to add Proxy PAC inside Mobile Apps

In order to use Appdome’s no code implementation of Proxy PAC on Appdome, you’ll need:

A PAC file is a text file that defines at least one JavaScript function, FindProxyForURL(url, host), with two arguments: url is the URL of the object and host is the host-name derived from that URL.

Example:

function FindProxyForURL(url, host) {
	// URLs from domains below example.com don't need a proxy
	if (shExpMatch(host, "*.example.com"))
	{
		return "DIRECT";
	}

	// URLs within this network are accessed through
	// port 8080 on fastproxy.example.com:
	if (isInNet(host, "10.0.0.0", "255.255.248.0"))
	{
		return "PROXY fastproxy.example.com:8080";
	}

	// All other requests go through port 8080 of proxy.example.com
	return "PROXY 203.0.113.0:8080";
}

Notice that the returned proxy can be:

  • DIRECT – no proxy is in effect
  • PROXY <IP:port> – proxy to the given IP and port
  • PROXY <host name:port> – proxy to the address resolved from the given host and port

If multiple options are given in a return statement, Appdome will only use the first.

For more information and examples regarding proxy.pac read here.

How to Add Proxy PAC Support to an App

Follow these step-by-step instructions to customize Any Mobile App:

Upload a Mobile App to Your Account

Please follow these steps to add a mobile app to your Appdome account.
If you don’t have an Appdome account, click here to create an account.

Select the Build TabNote: a blue underline will appear showing the step is active
Beneath the Build Tab, you will find several service options. Select AccessNote: a blue highlight will appear showing the category is active.

  1. Open Appdeom Acces Suite
  2. Open the sub-category Private Server Certificate and Authorities 
  3. Click on the toggle to enable Proxy Settings
  4. Enter a WPAD URL to a downloadable PAC file
  5. Enter The dedicated Proxy URL
  6. Upload a PAC file.
  7. press Build My App.

The technology behind Add Context to My App has two major elements – (1) a microservice architecture filled with 1000s of code sets needed for mobile integrations, and (2) an adaptive code generation engine that can recognize the development environment, frameworks and methods in each app and match the app to the relevant code-sets needed to customize your mobile app in seconds. For example, the technology supporting PAC files downloaded from a remote server, work that ordinarily a developer would need to do.

Congratulations! You now have a mobile app fully integrated with Proxy PAC.

After Adding Proxy PAC inside Mobile Apps on Appdome

Sign the Proxy PAC enabled Appdome-Built App

In order to deploy an Appdome-Built app, it must be signed. Signing iOS apps and Signing Android apps are easy using Appdome. Alternatively, you can use Private Signing, download your unsigned app and sign locally using your own signing methods.

Deploy the Appdome-Built App to a Mobile Device

Once you have signed your Appdome-Built app, you can download to deploy it using your distribution method of choice. For more information on deploying your Appdome-Built apps, please read this knowledge base.

That’s it – Enjoy Appdome Proxy PAC in your app!

How Do I Learn More?

To zoom out on this topic, visit  App Branding on Appdome on our website. 

Request a demo at any time.

If you have any questions, please send them our way at support@appdome.com or via the chat window on the Appdome platform.

Thank you!

Thanks for visiting Appdome! Our mission is to make mobile integration easy. We hope we’re living up to the mission with your project. If you don’t already have an account, you can sign up for free.

Kai Kenan

Have a question?

Ask an expert