Connection management and path selection between LAN-direct WebSockets and cloud relay URLs backed by the directory service.
Repository documentation index: docs/README.md
| Symbol | File | Role |
|---|---|---|
Manager |
manager.go |
Per-remote AgentConn pool; optional Resolver when wsURL is empty |
Resolver |
resolver.go |
Resolve(agentID) — prefers LAN map, then cloud LookupAgent when online |
CloudClient |
cloud.go |
HTTP client for directory: register, heartbeat, unregister, lookup, pubkey |
AgentConn, NewAgentConn |
conn.go |
WebSocket client connection between agents |
- Implement
CloudLookup(seeresolver.go) with*CloudClient(LookupAgentmatches the interface). AgentLookupResult.RelayEndpointis returned as the WebSocket URL when resolving in cloud mode.- Registration heartbeats:
CloudClient.StartHeartbeat(ctx, interval)/Stop()(unregister).
Directory API details: cloud/directory/docs/README.md.
Relay handshake and Bearer token format: cloud/relay/docs/README.md.
There is no config.json block for transport yet; callers construct NewCloudClient(directoryURL, identity) and NewResolver(cloud) in code. See cloud/directory/docs/CONFIG.md and cloud/relay/docs/CONFIG.md for service-side settings.
go test ./pkg/transport/...— includescloud_test.go,integration_test.goagainst the directory handler.