google: use cpcfg.ProxyFunc

This commit is contained in:
Yousong Zhou
2020-03-22 19:36:43 +08:00
parent 554e2e88dc
commit b3bd866239
+7 -1
View File
@@ -135,7 +135,13 @@ func NewGoogleClient(cfg *GoogleClientConfig) (*SGoogleClient, error) {
},
TokenURL: google.JWTTokenURL,
}
client.client = conf.Client(oauth2.NoContext)
httpClient := httputils.GetDefaultClient()
httputils.SetClientProxyFunc(httpClient, cfg.cpcfg.ProxyFunc)
ctx := context.Background()
ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
client.client = conf.Client(ctx)
return &client, client.fetchRegions()
}