July 13, 20262 minutes
In a federated network, peers need a way to discover each other. While you can manually configure peer URLs via environment variables or configuration files, a more scalable approach is auto-discovery using a standard well-known URI.
Relay implements /.well-known/relay following the pattern established by
RFC 8615 — Well-Known Uniform Resource
Identifiers. This allows any Relay instance to publish its capabilities,
protocol version, and peer list in a machine-readable format.
RFC 8615 defines a path prefix /.well-known/ that hosts can use to publish
machine-readable metadata. This is the same mechanism used by:
/.well-known/acme-challenge/ — Let’s Encrypt / ACME TLS certificates/.well-known/change-password — Password change URLs/.well-known/webfinger — WebFinger for ActivityPub and OStatusRelay extends this pattern with /.well-known/relay.
GET /.well-known/relayReturns a JSON document describing this relay node.
Example response:
{
"version": "0.2.0",
"protocol": "relay-federated",
"node_url": "https://relay.example.com",
"features": {
"instances": true,
"guestbook": true,
"security": true
},
"capabilities": [
"instance_directory",
"health_monitoring",
"guestbook_federation",
"security_intelligence"
],
"peers": [
"https://relay2.example.com",
"https://relay3.example.com"
]
}| Field | Type | Description |
|---|---|---|
version | string | Relay protocol version |
protocol | string | Always relay-federated |
node_url | string (optional) | This node’s public URL |
features | object | Feature flags enabled on this node |
capabilities | array | List of supported protocol capabilities |
peers | array (optional) | Known peer relay URLs |
The .well-known/relay endpoint is served automatically by the API server.
When a relay starts and has peers configured via --peers or RELAY_PEERS,
it will attempt to fetch /.well-known/relay from each peer to discover their
capabilities and their own peer lists (gossip propagation).
This enables a gossip-based discovery model:
/.well-known/relay from Node BYou can query your own relay’s well-known endpoint:
curl http://localhost:3000/.well-known/relayOr from another machine on the network:
curl http://192.168.1.140:3099/.well-known/relayThe .well-known/relay document is designed to be extensible. Future versions
may include:
public_key — Cryptographic identity for authenticated peer connectionssupported_transports — WebSocket, QUIC, WebRTClocation — Geo-location hint for latency-aware peer selectiontrust_score — Reputation metrics for anti-spam