Doku durchsuchen
Menü
Geändert am Auf GitHub bearbeiten

Server-API: connection

Als Markdown kopieren

Diese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in X-API-Key oder ein Anmelde-Token; siehe Die HTTP-API. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.

How devices connect: peer to peer first or always through the relay, and who may start a connection.

GET /api/connection/config

Show the connection policy.

On the server API, port 21114. Needs server.config.

200: The policy (application/json)

ConnectionSettings.

Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The connection configuration is not available

PUT /api/connection/config

Change the connection policy.

Saves the policy in the database and applies it at once, without a restart. The change is written in the audit log.

On the server API, port 21114. Needs server.config.

Request body, application/json:

Only these fields; any other field, a null boolean or a second JSON value is refused.

Field Type Required What it is
mode string, one of p2p_first, relay_only yes
p2p_fallback_ms integer yes at least 0, at most 30000
same_nat_relay boolean keeps its value when missing
allow_shared_nat_initiator boolean keeps its value when missing
logged_in_only_initiator boolean keeps its value when missing
operator_only_outbound boolean keeps its value when missing

200: Saved and applied (application/json)

Field Type
config ConnectionSettings
Error When
400 The body has an unknown field or a bad value, or mode or p2p_fallback_ms is missing
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The connection configuration is not available

Durchsucht Seiten, Abschnitte, Befehle und Einstellungen.