Administrator

Connecting to Relay Server at Runtime

After your Relay Servers have been installed and configured, you can configure an application to allow it to connect directly to the Relay Server farm at runtime.

Relay Server acting as a reverse proxy or load balancer performs the same role as Apache used in those capacities, but Relay Server requires additional parameters to be set. You do this by adding code to the application. For applications using Mobile Application Framework (MAF) login modules, additional application code is not required; you can simply specify the relay server parameters in the MAF login screen.

Android or iOS OData Applications

Use the sample code below in an Android or iOS OData application to connect with the ClientConnection object:

mSmphost ="<myrelayserver.com>";
mSmpPort= "80";
mSmpURLsuffix = "<path_to_relay_server_dll>";
mSmpFarmId = "<myrelayserver.com>”;
clientConnection.setConnectionProfile(true, mSmpHost, mSmpPort, mSmpURLsuffix, mSmpFarmId);

Android or iOS Kapsel Applications

Use the sample code below in an Android or iOS Kapsel application to connect with the ClientConnection object:

sURL= “<myrelayserver.com>”;
var oHeaders = {};                                                                                                  
var request = {
    headers : oHeaders,                    
    requestUri : sUrl,
    data: connectionData,
    method : "POST"
};
OData.request(request, onSuccessForRegister, onError);

With MAF Login Modules

If your application is using MAF login modules, you do not need to add code to the application. When setting up the MAF login, simply enter the Relay Server parameters in these fields in the MAF login screen:
  • Server Address – Relay Server hostname
  • Company ID – Relay Server farm name
  • URL Suffix – path to Relay Server .dll on Relay Server hostname