Tutorial: Client Configuration

Client Configuration

This page demonstrates how to setup a DXL client configuration for Node-RED. The configuration created by following the steps on this page can be used in conjunction with the other samples in the Node-RED OpenDXL contribution package.

Prior to setting up a DXL client configuration in Node-RED, make sure you have completed the client provisioning step.

In order to connect to the DXL fabric, each of the OpenDXL nodes need to be associated with a dxl client configuration node. Each dxl client node is associated with a separate connection to the DXL fabric. The same dxl client node can be associated with each DXL node which is intended to share a client connection. Multiple client configuration nodes can be created, for example, in order to bridge communication among different DXL fabrics.

The examples in the Node-RED OpenDXL contribution package do not include their own dxl client configuration node. You can either:

  • Create the client configuration node before importing any of the examples.
  • Import an example flow first and manually create a configuration node from within the edit dialog of one of the DXL nodes imported from the example.

Once the client configuration node has been created, the client node will be automatically associated with DXL nodes imported from other flows later on.

Creating the DXL Client Configuration

To create a DXL client configuration node, perform the following steps:

  1. In the upper-right corner of the Node-RED UI, press the side menu button.

  2. In the menu drop-down list, select ImportExamplesdxlcreate-client-config.

  3. To confirm that the configuration node was loaded properly, choose the Configuration nodes item under the side menu button. An item similar to the following should appear under the config tab on the right-side of the screen:

    Import Config Node

  4. Double-click the client node to open an edit window:

    Edit Config Node

    The value in the Config file text box determines the DXL client configuration file that the client node will use to determine how to connect to the DXL fabric.

    If you have already provisioned the Node-RED client configuration, you can change this value to the location of the dxlclient.config file and press the Update button to commit the change. You can then skip the remainder of the steps in this section.

    If you have not yet provisioned the Node-RED client configuration, you can provision the configuration from the Node-RED user interface by following the steps below.

  5. Click on the Provision new configuration button. This should open up a client provisioning window.

    Create Provision Config Empty

  6. Fill in values for the provisioning properties in the window.

    Enter the hostname or IP address of a provisioning server in the Host field and a Username and Password of a user authorized to perform the provisioning operation. In the Name field, enter the value which the provisioning server should store in the Common Name (CN) portion of the subject in the client certificate.

    The Config dir value controls the location on the Node-RED server where the configuration will be stored. The default value for this directory is a subdirectory named dxl under the Node-RED user directory. You may want to set this to a unique directory for the client configuration if you intend to use multiple DXL client configuration nodes in Node-RED. See the Node-RED Configuration documentation for more information on the Node-RED user directory.

    Create Provision Config Filled In

  7. Press the Provision button to complete the provisioning operation. If the operation succeeds, a message like the following should appear briefly:

    Provision Success

    The client node edit window should then reappear, with the location of the newly generated dxlclient.config file displayed for the Config file property:

    Edit Config Node With Config File

  8. Press the Update button to store the new client settings.

Manually Creating a Configuration Node

A DXL client configuration node can be created manually from within the edit dialog of another DXL node. For example, you could do the following:

  1. Drag a dxl event subscriber node from the Input palette into the flow panel.

    Add Event Subscriber Node

  2. Double-click the dxl subscriber event node to open an edit window:

    Edit Event Subscriber Node No Client

  3. Click on the pencil icon to the right of the Add new dxl-client... dropdown entry. This should open up an edit dialog box for a new client configuration node.

    The value in the Config file text box determines the DXL client configuration file that the client node will use to determine how to connect to the DXL fabric.

    If you have already provisioned the Node-RED client configuration, you can change this value to the location of the dxlclient.config file.

    If you have not yet provisioned the Node-RED client configuration, you can provision the configuration from the Node-RED user interface by clicking on the Provision new configuration button and filling in the provisioning information on the subsequent window which is displayed. For more information on filling out the values on the provisioning configuration window, see the steps in the Manually Creating a Configuration Node section.

    Once the Config file has been selected, enter a Name that Node-RED can associate with the configuration:

    Add Config Node

  4. Press the Add button to create the new configuration node. The configuration node will automatically be associated with the new event subscriber node:

    Edit Event Subscriber Node With Client

    Note that the Client field on each DXL node is a drop-down list box. A separate list item will appear for each client configuration node which has been defined. A DXL node may be associated with only one client configuration node.