Skip to content

Instantly share code, notes, and snippets.

@gistlyn gistlyn/main.dart
Created Dec 30, 2019

Embed
What would you like to do?
Dart Google protoc SSL GrpcServicesClient TodoWorld Example
import 'dart:io';
import 'package:grpc/grpc.dart';
import 'package:TodoWorld/services.pb.dart';
import 'package:TodoWorld/services.pbgrpc.dart';
void main(List<String> args) async {
var client = GrpcServicesClient(ClientChannel('todoworld.servicestack.net', port:50051,
options:ChannelOptions(credentials: ChannelCredentials.secure(
certificates: File('grpc.crt').readAsBytesSync(),
authority: 'todoworld.servicestack.net'))));
var response = await client.getHello(Hello()..name = 'gRPC Dart');
print(response.result);
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.