Hosting Apps Locally During Active Development

Version 2

    If you are using app-sandbox.jivesoftware.com for development the following does not apply to you.

     

    Dev Console is an app from Jive to facilitate managing development of internal apps.

    When using the Dev Console, developers will be prompted to specify an app gadget URL which will be used to identify the app for the Jive instance. This guide is intended to give some basic instructions for hosting the application on your local machine if so desired.

     

    Can internal developers use http://localhost.... url to register an app when using the Dev Console?

    localhost by convention is set to resolve to 127.0.0.1, so generally the answer is No. So if an app URL that has localhost such as http://localhost/.../app.xml is submitted to the Dev Console the Jive server won't be able to fetch it, likely symptoms being 404 or connection timeout.

     

    If, however, the developer is hosting their app on the same machine where Jive itself is running - a less likely use case - the answer will be yes.

     

    So a developer's desktop/laptop cannot be used to host apps?

    It can be used if all three of these conditions are met:

    1. If the LAN/WAN IP address assigned to the user's computer is reachable from Jive server where the app is being developed or will be published.
    2. The IP address is not dynamically assigned, meaning it does not chane periodically or after restarts. (or if a domainname is used it always resolves to user's computer).
    3. Jive admin whitelists user's host.

     

    It is easy to lookup the IP address or even better domainname (if one was given) of the internal developer's computer but the way to find out differs across OSes. See reference below for "how". The app URL will then look like http://10.65.118.13/.../app.xml provided a HTTP server such as Apache or IIS is setup and started to listen at port 80 and app is hosted there. If a domainname was provided that would resolve to that IP address, that would be an even better option.

     

    Jive server will not be able to fetch this -- or as a matter of course all XHR requests that the app makes -- through osapi.http.* or gadget.io.makeRequest where the URL points to a server running inside the company's LAN. This is due to a security restriction that protects external apps from sniffing around unprotected servers running behind the firewall. But for genuine accesses such as internal app development, the Jive admin can enable access to internal IP addresses by setting the Jive property:

    jive.apps.proxy.whitelist.cidrs

     

    The value of this property should be one or more ranges of IP addresses in space separated CIDR format.

     

    References: