Get the relay's peers
const url = 'https://switchboard.mux.global/cluster/connect?jwt=example&jwt=<jwt>';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The Node key.
Added by the relay from [cluster] node. It has to match the URL
the Node was enrolled with.
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.
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.
Header Parameters
Section titled “Header Parameters”Responses
Section titled “Responses”The URLs this relay should dial.
Example
[ "https://relay2.acme.example:4443/"]Headers
Section titled “Headers”Example
max-age=15The 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.
object
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.
object
Example generated
{ "error": "example"}