Skip to content

Get the relay's peers

GET
/cluster/connect
curl --request GET \
--url 'https://switchboard.mux.global/cluster/connect?jwt=example&jwt=<jwt>'

The relay polls this about once a second, using the connect_api URL from enrollment, and dials every URL in the list. Each pair of peers is dialed from one side only, so two relays in the same Region don’t both appear in each other’s lists.

A relay that stops polling is dropped from its peers’ lists after 90 seconds.

If Switchboard can’t be reached, the relay keeps the peers it has.

jwt
required
string

The Node key.

node
string

Added by the relay from [cluster] node. It has to match the URL the Node was enrolled with.

region
string

If present, it has to match the Region the Node was enrolled in. A Node’s Region can’t change. To move a relay, enroll it again.

client
string

If present, it has to match the client_url the Node was enrolled with, character for character. The relay can repeat its Client URL but can’t set or change it. The poll is a 400 if the Node was enrolled without a client_url, or if the value is empty or doesn’t start with http:// or https://.

A 400 here repeats on every poll, so a relay with a wrong client= gets no peers and, after 90 seconds, drops out of its peers’ lists too. Leave it out unless you want the poll to check it.

If-None-Match
string

The URLs this relay should dial.

Media typeapplication/json
Array<string>

Example

[
"https://relay2.acme.example:4443/"
]
ETag
string
Cache-Control
string
Example
max-age=15

The list hasn’t changed since the ETag sent in If-None-Match.

node, region or client doesn’t match what the Node was enrolled with.

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}

No credential, or the Node key is unknown. An unknown Node key usually means the Node was deleted, and the relay has to be enrolled again.

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}