Remove TLS requirement for gRPC client

This commit is contained in:
Hellojack
2023-04-04 21:09:08 +08:00
committed by 世界
parent 3a92bf993d
commit ec2d0b6b3c
5 changed files with 42 additions and 38 deletions

View File

@@ -43,7 +43,9 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
},
}
} else {
tlsConfig.SetNextProtos([]string{http2.NextProtoTLS})
if len(tlsConfig.NextProtos()) == 0 {
tlsConfig.SetNextProtos([]string{http2.NextProtoTLS})
}
transport = &http2.Transport{
ReadIdleTimeout: time.Duration(options.IdleTimeout),
PingTimeout: time.Duration(options.PingTimeout),