From f9850c203c3f9131122faa8f7cfd387555a80ab6 Mon Sep 17 00:00:00 2001 From: xniu Date: Thu, 25 Aug 2022 16:36:13 +0800 Subject: [PATCH] feat: add support for ALL_PROXY Signed-off-by: xniu --- go.mod | 2 +- util/grpc/grpc.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index e03d1709e3220..f396b45234e25 100644 --- a/go.mod +++ b/go.mod @@ -262,7 +262,7 @@ require ( go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/net v0.17.0 golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 diff --git a/util/grpc/grpc.go b/util/grpc/grpc.go index 1741727a5d604..536da792e3048 100644 --- a/util/grpc/grpc.go +++ b/util/grpc/grpc.go @@ -10,6 +10,7 @@ import ( "github.com/argoproj/argo-cd/v2/common" "github.com/sirupsen/logrus" + "golang.org/x/net/proxy" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" @@ -63,7 +64,7 @@ func BlockingDial(ctx context.Context, network, address string, creds credential dialer := func(ctx context.Context, address string) (net.Conn, error) { - conn, err := (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address) + conn, err := proxy.Dial(ctx, network, address) if err != nil { writeResult(err) return nil, err