mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
Use HTTP/1.1 on the gRPC client
This commit is contained in:
parent
34e97347f2
commit
8593240692
|
@ -4,6 +4,7 @@ using Grpc.Core;
|
|||
using Grpc.Net.Client;
|
||||
using System;
|
||||
using System.Management;
|
||||
using System.Net.Http;
|
||||
using System.ServiceProcess;
|
||||
using System.Threading.Tasks;
|
||||
using WelsonJS.GrpcService;
|
||||
|
@ -54,8 +55,13 @@ namespace WelsonJS.Service
|
|||
{
|
||||
try
|
||||
{
|
||||
HttpClientHandler httpHandler = new HttpClientHandler();
|
||||
|
||||
this.parent.Log($"Use the remote address: {serverAddress}");
|
||||
channel = GrpcChannel.ForAddress(serverAddress);
|
||||
channel = GrpcChannel.ForAddress(serverAddress, new GrpcChannelOptions
|
||||
{
|
||||
HttpHandler = httpHandler // use HTTP/1.1
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user