controlUri property

Uri get controlUri

The control-channel URL the agent actually dials: hubUri with nodeMount as its path.

An operator configures the Hub (wss://hub:8443), not the mount, so the path is filled in here. A hubUri that already carries one is respected — that is how a node reaches a Hub mounted somewhere non-default, or one behind a reverse proxy that rewrites the path.

Implementation

Uri get controlUri {
  final path = hubUri.path;
  if (path.isEmpty || path == '/') return hubUri.replace(path: nodeMount);
  return hubUri;
}