mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-28 10:31:04 +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 Grpc.Net.Client;
|
||||||
using System;
|
using System;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
|
using System.Net.Http;
|
||||||
using System.ServiceProcess;
|
using System.ServiceProcess;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using WelsonJS.GrpcService;
|
using WelsonJS.GrpcService;
|
||||||
|
|
@ -54,8 +55,13 @@ namespace WelsonJS.Service
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
HttpClientHandler httpHandler = new HttpClientHandler();
|
||||||
|
|
||||||
this.parent.Log($"Use the remote address: {serverAddress}");
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user