// Web channel factory — gRPC-Web over HTTP/1.1. // Selected on dart:html targets (Flutter web, Dart-for-web) via // the conditional import in hub_client.dart. The hub must be // running with `tonic-web` enabled — see fai_platform docs // architecture/protocol-surfaces.md. import 'package:grpc/grpc_connection_interface.dart'; import 'package:grpc/grpc_web.dart'; import 'hub_client.dart' show HubEndpoint; ClientChannelBase createChannel(HubEndpoint endpoint) { final scheme = endpoint.secure ? 'https' : 'http'; return GrpcWebClientChannel.xhr( Uri.parse('$scheme://${endpoint.host}:${endpoint.port}'), ); }