When developing a Worklight application, there are various places the hostname of your Worklight server might need to be specified, and might end up:
- In the mobile app itself (the .ipa, .apk etc.) – this value (prior to Worklight V6) was taken from the application-descriptor.xml file during the build of the application and determines where the app attempts to connect back to for adapter calls and so on. In versions of Worklight subsequent to V6, it is now specified instead in the <app-builder> ANT task (used for automated builds of the application) inside the worklightServerHost property.
- In the publicWorkLightHostname, publicWorkLightProtocol, and publicWorkLightPort values inside the worklight.properties file. These values determine:
- Where the Mobile web and desktop browser apps should connect back to.
- How the Worklight Application Center (if used) will form RESTful URLs for its own internal use.
In all cases, these hostnames should point to the externally-resolvable address of the Worklight server (in front of any load-balancers, firewalls, proxies, etc.).
Thanks to Itay Hindy and Thomas Kw Poon for help with this tip.