grpc / grpc-dart

The Dart language implementation of gRPC.
https://pub.dev/packages/grpc
Apache License 2.0
835 stars 256 forks source link

feature: grpc endpoint prefix for web and native #698

Closed GuillermoDLCO closed 2 months ago

GuillermoDLCO commented 2 months ago

Description

There are some prefixes that we can assign in gateways to redirect to our services. This feature enable an option prefixPath for that purpose

gRPC Native

    ClientChannel(
        host,
        port: port,
        prefixPath: nativePrefixPath,
        options: ChannelOptions(
          connectTimeout: const Duration(seconds: 6),
          connectionTimeout: const Duration(seconds: 6),
          idleTimeout: const Duration(seconds: 6),
          codecRegistry:
              CodecRegistry(codecs: const [GzipCodec(), IdentityCodec()]),
        ),
      )

gRPC Web

      GrpcWebClientChannel.xhr(
        Uri.parse('$host:$port'),
        prefixPath: webPrefixPath,
      );
linux-foundation-easycla[bot] commented 2 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.