How to connect to the QLM License Server via a proxy server

Overview

If a client computer connects to the internet via a Proxy Server that requires authentication, you must configure QLM to use the proxy server.

Note that nowadays, proxy servers have become less common. For the few cases where proxy servers are used by your customers, you may elect to perform an offline activation instead.

QLM License Wizard

The QLM License Wizard allows your customer to configure their proxy settings as shown in the screenshot below. Once configured, the wizard stores the proxy settings on the system.

If you are not using the QLM License Wizard, you must create a user interface that allows the customer to enter their proxy settings. You must then store them for subsequent use.

Code Level changes

If you are using the QLM License Wizard, no code changes are required. The QLM License Wizard stores the proxy settings in a location that the QlmLicense object can access and hence use to connect to the License Server.

If you are not using the QLM License Wizard, you must manage the proxy settings by storing them and reading them yourself.

When calling an API that communicates with the QLM License Server, you must set the following proxy settings properties: UseProxy, ProxyUser, ProxyDomain, ProxyPassword, ProxyHost, ProxyPort

After these properties are set, you can call any API that communicates with the QLM License Server.

To detect that the customer requires authentication through a proxy server, you need to catch the exception that is thrown when the QLM API fails.

try
{  
   license.ActivateLicense(...);
}
catch (System.Net.WebException wex)
{   
   if (wex.Message.IndexOf("407") != -1)
   {
      // Customer user proxy server that requires authentication.
      // Configure the proxy settings - it is not recommended to put all this code in the catch clause - this is just to show you what APIs to call

      license.UseProxy = true;
      license.ProxyUser = "xxx";
      license.ProxyPassword= "***";
      license.ProxyDomain = "yyy";

      license.ProxyHost= "zzz";
      license.ProxyPort= 8080;
      license.ActivateLicense (...);
   }
   else
   {
      // error
      return;
   }
}
catch (Exception ex)
{
   // error
   return;
}

Last updated