< Table of Contents

Setting Up the Gateway and Clients

This guide helps you download the Gateway distribution and set it up in your environment:

Let’s get started!

Setting Up Kaazing WebSocket Gateway Clients

To set up Kaazing WebSocket Gateway clients, go to kaazing.com/download, click the name of the client SDK you want, and follow the instructions. You can download the client SDKs to your computer, install them via a package manager, or include them in your development environment via other means such as a content delivery network.

Kaazing WebSocket Gateway Client Tutorial Applications

There are tutorial applications publicly available on Github for all of the Kaazing WebSocket Gateway clients:

Setting Up the Gateway Locally on My Computer

Setting up Kaazing Gateway on your local computer is recommended if you want to quickly try out the Gateway.

A Localhost configuration for Kaazing Gateway

Figure: A Localhost Configuration for Kaazing Gateway

To download and set up the Gateway on your local computer, perform the following steps:

  1. Ensure your system meets the system requirements. See the kaazing.com/download, and you can find the README.txt in the GATEWAY_HOME directory if you have already unpacked the the Gateway distribution.
  2. Download the Kaazing WebSocket Gateway - Enterprise Edition from kaazing.com/download. You can also fork the open source Kaazing WebSocket Gateway - Community Edition from the GitHub repository at kaazing.org. See that repo's README file for instructions on installing the Gateway.
  3. Install the Gateway by unpacking the compressed download of the Gateway.

    Unpack the Gateway to any directory location. Unpacking creates the Gateway directory structure into a directory of your choice (for example, C:\kaazing or /home/username/kaazing). See About GATEWAY_HOME to learn more about Kaazing Gateway directory destinations.

  4. Start a local Gateway.

    • For Windows: use the Windows Services Manager or use the net start command with administrator rights. Alternatively, in Windows Explorer, navigate to the GATEWAY_HOME/bin directory where you unpacked the Gateway and double-click the gateway.start.bat script.
    • For Linux: sudo service kaazing-gateway-community-5.0.x-platform start
    • For Ubuntu (Upstart): sudo start kaazing-gateway-community-5.0.x-platform
    • For Linux, UNIX, or Mac: run the gateway.start script by navigating to the GATEWAY_HOME/bin directory where you installed the Gateway and enter ./gateway.start on the command line.

    You can also start one of the pre-packaged brokers and the Gateway.

    Start the gateway using the pre-packaged AMQP broker:

    ./bin/gateway.start --broker amqp (Linux/Mac), or ./bin/gateway.start.bat --broker amqp (Windows)

    Start the gateway using the pre-packaged JMS broker:

    ./bin/gateway.start --broker jms (Linux/Mac), or ./bin/gateway.start.bat --broker jms (Windows)

    When you successfully start the Gateway, messages display in your shell or command prompt indicating the services that are hosted by the Gateway. The startup message may differ depending on your Gateway configuration. To verify that the Gateway started correctly as a service, look at the log file in GATEWAY_HOME/log/service.log that is generated when the service is started or stopped. If the server does not start successfully, see Troubleshoot Kaazing Gateway Configuration and Startup or contact your administrator.

  5. Verify the Gateway setup.

    To verify that the Gateway is up and running, open a browser and access the Gateway home page at http://localhost:8000/. The “It Works!” page displays.

You are now done setting up the Gateway locally.

Setting Up the Gateway on a Server

You can override the Gateway default behavior and accept connections on a non-localhost host name or IP address.

This graphic shows a server configuration for Kaazing Gateway

Figure: A Server Configuration for Kaazing Gateway

To set up a server configuration:

  1. Follow the directions in Setting Up Kaazing Gateway Locally on My Computer.
  2. Stop the Gateway.
    • To stop the Gateway on Windows, use the Windows Services Manager, press CTRL + C at the command prompt that was used to start the Gateway or simply close the command prompt, or use the net stop command to stop the Gateway service.
    • To stop the Gateway on Linux, UNIX, and Mac, kill the process at the command line, or use the Linux or Ubuntu (Upstart) service stop command.
  3. Navigate to the GATEWAY_HOME/conf/ directory and edit the Gateway configuration to update the value of the gateway.hostname property by replacing localhost with your host name or IP address.
    1. Edit the Gateway configuration file you are using, either gateway-config.xml (default) or gateway-config-minimal.xml, or edit your custom configuration file if you created one. The Gateway configuration files are described in detail in About Gateway Configuration.
    2. Replace localhost with your host name or IP address.

      For example, the hostname example.com replaces localhost as the property value for gateway.hostname in the following Gateway configuration file:

      <properties>
        <property>
          <name>gateway.hostname</name>
          <value>example.com</value>
        </property>
        <property>
          <name>gateway.base.port</name>
          <value>8000</value>
        </property>
        <property>
          <name>gateway.extras.port</name>
          <value>8001</value>
        </property>
      </properties>
      

      Note: You can optionally specify default values for configuration elements using the properties element in the “Property defaults” section of the Gateway configuration file. Doing so is recommended because it allows you to define a property value once and have its value used throughout the configuration.

  4. If you are using a message broker, start it. You can also start one of the pre-packaged brokers and the Gateway.

    Start the gateway using the pre-packaged AMQP broker:

    ./bin/gateway.start --broker amqp (Linux/Mac), or ./bin/gateway.start.bat --broker amqp (Windows)

    Start the gateway using the pre-packaged JMS broker:

    ./bin/gateway.start --broker jms (Linux/Mac), or ./bin/gateway.start.bat --broker jms (Windows)

  5. Start and verify the Gateway (as described in Setting Up Kaazing Gateway Locally on My Computer).

Setting Up a Secure Kaazing Gateway Configuration

By default, the Gateway listens for non-encrypted traffic. Secure communication between the browser and the server is necessary to ensure that only the intended recipient of a message can read the transmitted message and to allow the message recipient to trust that the message is indeed from the expected source.

An encrypted configuration using Kaazing Gateway

Figure: An Encrypted Configuration Using Kaazing Gateway

For secure communication with the Gateway, consider configuring for the following levels of security:

Uninstall Kaazing Gateway

Uninstall the Gateway by stopping all the services and deleting the directory that contains the Gateway files.