[id='configuring-connections_{context}']
= Configuring {brandname} connections
Configure {hr_js} clients to connect to {brandname} Server.

.Prerequisites

* Install the {hr_js} client.
* Have at least one running {brandname} Server instance.

.Procedure

* Specify hostnames and ports for {brandname} Server in the client configuration.
+
[source,javascript,options="nowrap",subs=attributes+]
----
include::code_examples/connection-multiple-servers.js[]
----

The preceding configuration example includes connection details for two servers.
When you add multiple server addresses to the configuration, the {hr_js} client loops through them until it finds a node to which it can connect.

However, you only need to add one {brandname} Server address for the client to receive the entire cluster topology.
If the {hr_js} client connects to a single server instance that is a member of a cluster, the client gets the address information for all nodes.

Because {hr_js} clients are topology aware, if a connection to one {brandname} Server breaks, the client retries any incomplete operations on other nodes in the cluster.
Likewise, if client listener that is registered on one {brandname} Server fails or leaves the cluster, the client transparently migrates the listener registration to another node in the cluster so that it can continue receiving events.
