AIR, ADT, Java, and Proxies

AIR applications, when accessing content via HTTP or HTTPS, always do so via the system proxy settings. On Windows that means they use the same settings as Internet Explorer. On Mac OS, those are the same settings as used by Safari. It’s hard to use a machine if the system proxy settings aren’t correct, so users typically have this set up early on and then don’t have to think twice about it—it just works.

The folks over at Sun who had to implement Java for Windows had other ideas, and gave Java its own proxy settings. If you have to explicitly enter your proxy settings for your operating system, you most likely will have to separately enter those settings to any JRE you’ve installed. In current versions of Java, these settings are accessed via the Java Control Panel.

ADT is, as explained earlier, written in Java. It also generally has to access the network when signing in order to obtain a secure timestamp; that server is accessed via an HTTP request. The end result? Developers often find that AIR applications can access the network just fine during development, but when it comes time to create an AIR file, packaging fails because a timestamp can’t be created.

If you run into this situation, be sure to check your Java proxy settings—and make sure you’re checking for the same JRE that ADT is using. (If you have more than one JRE, they may not be sharing proxy settings.) I do not recommend disabling timestamping, for reasons I’ll explain later.

3 Responses to AIR, ADT, Java, and Proxies

  1. barry.b says:

    thanx for the heads-up, Oliver. it’s something easily overlooked.

  2. dan says:

    “AIR applications, when accessing content via HTTP or HTTPS, always do so via the system proxy settings. On Windows that means they use the same settings as Internet Explorer.”I’ve worked as a windows application developer in the past and 3rd party applications can only use non-password protected proxy servers with this method (assuming you don’t host an IE ActiveX control, and you decided to grab the regkey for the configured proxy server). Are their plans to allow air applications to manually set the proxy info so that we can deploy this in the real world to enterprise customers? It appears to be one of the gaping holes in the AIR platform from what I’ve been able to piece together). When can we expect this to be supported, or is it and I just haven’t found the hidden spot where it’s documented?Thanks,Dan

  3. Oliver Goldman says:

    @Dan: If the proxy server requires a password, AIR will prompt the user for it.