clientFromLocalCe function

Future<KumihoClient?> clientFromLocalCe({
  1. Duration? timeout,
  2. Client? httpClient,
})

Creates a tokenless KumihoClient for a loopback self-hosted CE server.

Returns null (does not throw) when no local CE server is present. The returned client never loads an auth token, never runs discovery, and never auto-logs-in — it is strictly the loopback CE path.

Implementation

Future<KumihoClient?> clientFromLocalCe({
  Duration? timeout,
  http.Client? httpClient,
}) async {
  final target = await resolveLocalCeEndpoint(
    timeout: timeout,
    httpClient: httpClient,
  );
  if (target == null) {
    return null;
  }

  final (host, port) = _splitTarget(target);
  return KumihoClient(
    host: host,
    port: port,
    secure: false,
    autoLoadToken: false,
  );
}