getChannel method

GrpcOrGrpcWebClientChannel getChannel()

Creates a new ClientChannel using the optional given options.

Implementation

GrpcOrGrpcWebClientChannel getChannel() {
  final finaleWebHost = webHost ?? host;
  return GrpcOrGrpcWebClientChannel.toSeparateEndpoints(
    grpcHost: host.replaceFirst(RegExp('http(s)?://'), ''),
    grpcPort: port,
    grpcTransportSecure: credentials == ChannelCredentials.secure(),
    grpcWebHost: finaleWebHost.replaceFirst(RegExp('http(s)?://'), ''),
    grpcWebPort: webPort,
    grpcWebTransportSecure: webTransportSecure,
  );
}