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

浙公网安备 33010602011771号