grpc ico 注入方式 Client注册

#region gRPC Client注册
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);///https 调用可以忽略 这个方法  http 调用添加此方法
builder.Services.AddGrpcClient<xxx>(options =>
{
    options.Address = new Uri("http://localhost:5000");
    options.Address = new Uri("https://localhost:7000");
}).ConfigureChannel(grpcOptions =>
{
    //可以完成各种配置   aop  拦截   token 
});
#endregion

  

posted @ 2022-01-17 16:14  非著名架构师  阅读(113)  评论(0编辑  收藏  举报