Bridge Discovery & Metrics
Server-to-server bridge exit-server discovery, forced re-discovery, cached exit-server listing, and live relay performance metrics on OrbMesh bridge nodes.
Overview
A bridge (entry) server does not hard-code its exit servers. Instead it runs a discovery service that periodically pulls the current set of healthy exit servers from OrbNET, caches them, and uses that cache to resolve the exit_server_id passed to /bridge/connect. These endpoints let you inspect discovery state, force an immediate refresh, list the cached exit servers, and read live relay metrics.
Available on Bridge Nodes Only
Discovery endpoints are registered only when both bridge mode and discovery are enabled on a server (bridge.enabled and bridge.discovery_enabled). The discovery service runs automatically on a configurable interval, defaulting to 5 minutes.
Discovery Status
Returns the current state of the bridge discovery service: whether it is enabled, its polling interval, when it last ran, how many exit servers it discovered and currently has cached, and the last error if discovery failed.
/bridge/discovery/statusGet the bridge discovery service state, interval, and cache counts
Code Examples
curl -X GET https://198.51.100.1:8443/bridge/discovery/statusResponse
{
"enabled": true,
"interval": "5m0s",
"last_discovery": "2026-02-08T14:25:00Z",
"discovered_count": 18,
"cached_count": 22,
"current_server_id": "srv_eu_de_01"
}Response Fields
| Field | Type | Description |
|---|---|---|
enabled | boolean | Whether discovery is enabled on this bridge node |
interval | string | Discovery polling interval (Go duration, e.g. 5m0s) |
last_discovery | string | ISO 8601 timestamp of the most recent discovery run |
last_error | string | Error message from the last failed discovery run. Omitted when discovery is healthy. |
discovered_count | integer | Number of exit servers found in the last successful discovery |
cached_count | integer | Total exit servers currently in the cache (includes statically configured servers) |
current_server_id | string | This bridge node's own server ID |
Force Discovery
Triggers an immediate discovery run instead of waiting for the next interval. Useful after provisioning a new exit server so the bridge can route to it right away. Returns the refreshed status.
/bridge/discovery/forceForce an immediate exit-server discovery run and return updated status
Code Examples
curl -X GET https://198.51.100.1:8443/bridge/discovery/forceResponse
{
"success": true,
"status": {
"enabled": true,
"interval": "5m0s",
"last_discovery": "2026-02-08T14:33:10Z",
"discovered_count": 19,
"cached_count": 23,
"current_server_id": "srv_eu_de_01"
}
}{
"success": false,
"error": "failed to reach OrbNET backend: context deadline exceeded"
}List Cached Exit Servers
Returns the bridge node's cached set of exit servers -- the candidates it can relay to. Each entry includes connection details and per-protocol ports.
/bridge/discovery/serversList the bridge node's cached exit servers and their connection details
Code Examples
curl -X GET https://198.51.100.1:8443/bridge/discovery/serversResponse
{
"count": 2,
"servers": [
{
"id": "srv_us_ny_02",
"name": "US New York 02",
"address": "203.0.113.50:8443",
"https_port": "8443",
"vless_port": 10086,
"wg_port": 51820,
"ssh_port": 2222,
"protocols": ["wireguard", "vless", "orbconnect", "ssh"],
"priority": 10,
"enabled": true
},
{
"id": "srv_us_la_01",
"name": "US Los Angeles 01",
"address": "203.0.113.51:8443",
"https_port": "8443",
"vless_port": 10086,
"wg_port": 51820,
"ssh_port": 2222,
"protocols": ["wireguard", "vless", "orbconnect", "ssh"],
"priority": 20,
"enabled": true
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
count | integer | Number of cached exit servers |
servers[].id | string | Exit server identifier. Use this as exit_server_id in /bridge/connect. |
servers[].name | string | Human-readable server name |
servers[].address | string | Exit server HTTPS API address in host:port form |
servers[].https_port | string | HTTPS API port (default 8443) |
servers[].vless_port | integer | VLESS port used for bridge mode (default 10086) |
servers[].wg_port | integer | WireGuard port (default 51820) |
servers[].ssh_port | integer | SSH port for bridge mode (default 2222) |
servers[].protocols | string[] | Protocols the exit server supports |
servers[].priority | integer | Selection priority; lower is preferred |
servers[].enabled | boolean | Whether the exit server is currently usable |
Bridge Metrics
Returns a detailed snapshot of bridge relay performance: session counts, byte and packet totals, tunnel statistics, latency, and per-exit-server breakdowns. This complements the lighter-weight /bridge/health endpoint with full metrics for dashboards and capacity planning.
/bridge/metricsGet a detailed snapshot of bridge relay performance metrics
Code Examples
curl -X GET https://198.51.100.1:8443/bridge/metricsResponse
{
"total_sessions": 12834,
"active_sessions": 47,
"failed_sessions": 213,
"total_bytes_sent": 184329472000,
"total_bytes_received": 612847104000,
"total_packets_sent": 142500000,
"total_packets_received": 488200000,
"active_tunnels": 94,
"tunnel_created": 9241,
"tunnel_reused": 3593,
"tunnel_failed": 88,
"avg_latency_ms": 23.4,
"max_latency_ms": 142.7,
"min_latency_ms": 8.1,
"exit_server_stats": {
"srv_us_ny_02": {
"server_id": "srv_us_ny_02",
"active_sessions": 31,
"total_sessions": 8420,
"bytes_sent": 120000000000,
"bytes_received": 410000000000,
"avg_latency_ms": 21.8,
"failed_connections": 42,
"last_used": "2026-02-08T14:32:51Z"
}
},
"start_time": "2026-02-05T09:00:00Z",
"last_activity": "2026-02-08T14:32:51Z"
}Key Response Fields
| Field | Type | Description |
|---|---|---|
total_sessions / active_sessions / failed_sessions | integer | Lifetime, current, and failed bridge session counts |
total_bytes_sent / total_bytes_received | integer | Total bytes relayed in each direction since startup |
total_packets_sent / total_packets_received | integer | Total packets relayed in each direction |
active_tunnels | integer | Currently open entry-to-exit tunnels |
tunnel_created / tunnel_reused / tunnel_failed | integer | Exit-tunnel lifecycle counters (tunnels are pooled and reused across sessions) |
avg_latency_ms / max_latency_ms / min_latency_ms | number | Relay latency statistics in milliseconds |
exit_server_stats | object | Per-exit-server metrics keyed by exit server ID |
start_time / last_activity | string | ISO 8601 service start and last-activity timestamps |
Health vs. Metrics
Use /bridge/health for a quick load-balancer probe (status, active session count, average latency). Use /bridge/metrics for full observability -- byte/packet counters, tunnel pooling efficiency, and per-exit-server breakdowns.
Related Endpoints
- Bridge Mode -- Establish, monitor, and disconnect bridge sessions
- Smart Connect -- Bridge recommendations based on network analysis
- Health & Monitoring -- Server-wide health and protocol status