Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active December 31, 2019 04:30
Show Gist options
  • Save gistlyn/a420d1389e1a409c30399e9aaf286c03 to your computer and use it in GitHub Desktop.
Save gistlyn/a420d1389e1a409c30399e9aaf286c03 to your computer and use it in GitHub Desktop.
C# Google protoc insecure GrpcServicesClient TodoWorld Example
using System;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Net.Client;
namespace TodoWorld
{
class Program
{
static async Task Main(string[] args)
{
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
var client = new GrpcServices.GrpcServicesClient(
GrpcChannel.ForAddress("http://todoworld.servicestack.net:5054"));
var response = await client.GetHelloAsync(new Hello { Name = "gRPC C#" });
Console.WriteLine(response.Result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment