javascript Quickstart


In this quickstart you will create a service that receives a name from a client and responds to the client with a message. Communication between the client and service is facilitated by the Netifi Broker.


You need the following items installed on your machine to run the quickstart:

Get Started

Follow the steps below to get up and running with Netifi quickly.

  1. Clone Netifi Quickstart JS Project

    Clone the Netifi Quickstart JS project from Github.

    git clone -b 1.6.9 --single-branch
  2. Build the Project

    After you have cloned the project change to the netifi-quickstart-js directory and build the project:

    cd netifi-quickstart-js && yarn install && yarn protoc
  3. Run the Broker Locally

    Run a local instance of the broker with Docker for your clients and server to connect with

    1. Download the Broker

      Once the project is built, you need to download the Netifi Broker. The broker is distributed as a Docker container on Docker Hub. To download the Netifi Broker Docker image, run the following command in a new terminal window:

      docker pull netifi/broker:1.6.9
    2. Start the Broker

      Now that you have downloaded the broker from Docker Hub, start it by running the following command:

      docker run \
      -p 7001:7001 \
      -p 8001:8001 \
      -p 8101:8101 \
      '' \
      '-Dnetifi.authentication.0.accessKey=9007199254740991'  \
      '-Dnetifi.authentication.0.accessToken=kTBDVtfRBO4tHOnZzSyY5ym2kfY=' \
      '' \
      ''" \
  4. Run the Node App

    An npm script starts the HelloService server on port 9091:

    yarn server
  5. Run the Browser App

    Running the project with 'start' will start a webserver that hosts the client application at port 3000:

    yarn start
  6. View the Browser App

    Open one or more browser tabs and navigate to


    The application calls "SayHello" on the Node HelloService, reflected in its log. The Client application will print out the response.

  7. Optional: Reverse Roles of Browser and Node

    A couple of changes are required to reverse the roles of the Browser and Node.

    1. Modify the Browser App

      A small change is required to start the Browser app as a server. In the root netifi-quickstart-js directory, open the file webpack.config.js. Line 14 reads

      '__AS_SERVER__': false,

      Change the value to true

      '__AS_SERVER__': true,

      and save the file.

    2. Run the Browser App

      Running the project will start a webserver that hosts the application at port 3000 as before but now it runs as a HelloService server:

      yarn start
    3. View the Browser App

      Open one of more browser tabs and navigate to


      The application connects to the local Broker as a HelloService server.

    4. Run the Node App

      Running this npm script will start the node process as a HelloService client:

      yarn server-as-client

      The console now indicates that the Node app acted as a client and received a reply from the Browser!


Now that you have a service, client, and broker successfully running. See if you can implement a ping-pong service whereby the client repeatedly pings the service, and the service always replies with a pong.

An example implementation is in the ping-pong-solution branch.

Background Image

Check out our blog to learn more about Netifi and RSocket.

Read Our Blog