A proxy for CloudBees Feature Management

2 minute read
On this page

Applications using the CloudBees Feature Management service do so through one of the CloudBees Feature Management SDKs.

The SDKs need to connect across the public internet to the CloudBees Feature Management service for multiple reasons, for example, to get feature flag configurations and to upload impression data. This can be a problem for application code running inside a closed/secured network, where direct access to the public internet is blocked, such as for security reasons.

To help with this, CloudBees Feature Management provides a proxy created specifically to allow application code, using one of the CloudBees Feature Management SDKs, to proxy all network traffic to the CloudBees Feature Management backend services. This proxy is provided as a Docker image.

Using the proxy involves two steps:

  1. Running the proxy on a machine or node with the following capabilities:

    1. The machine or node must have public internet access.

    2. The application running the CloudBees Feature Management SDK must be able to connect to the machine or node using the proxy.

  2. Updating the application’s CloudBees Feature Management SDK code to use the proxy.

    For more information, refer to Using the proxy for all SDK languages.

Figure 1. The CloudBees Feature Management SDK within the application uses the system network to connect with the proxy, which then connects to CloudBees over the public internet.

Using the proxy

To use the proxy:

  1. Run the Proxy Docker image.

    The Proxy Docker image and Documentation are available on DockerHub: A simple proxy for CloudBees Feature Management SDKs.
  2. Make sure that any applications connected to CloudBees have CloudBees Feature Management SDKs installed that can access the proxy.

    For more information, refer to CloudBees Feature Management SDK installation.

    Please refer to the CloudBees Feature Management changelog for each SDK to verify when the proxy support was added.
  3. Provide the proxy option to the roxOptions object when calling Rox.Setup for each application that uses the CloudBees Feature Management SDK.

  4. Add the following code to the SDK code to enable the SDK to use the proxy.

    The SDK code changes for each language are as follows:

    React Native
    JavaScript
    Node.js
    .NET
    const options = {
      proxy: {
        protocol: 'https',
        host: 'companyProxy'
      }
    }
    const options = {
      proxy: {
        protocol: 'https',
        host: 'companyProxy'
      }
    }
    const options = {
      proxy: {
        protocol: 'https',
        host: 'companyProxy'
      }
    }
    var options = new RoxOptions(new RoxOptions.RoxOptionsBuilder
    {
        Proxy = new WebProxy(new Uri("https://companyProxy"))
    });