diff --git a/api/client.go b/api/client.go index 368b3b05..bb024fdb 100644 --- a/api/client.go +++ b/api/client.go @@ -49,6 +49,7 @@ type ErrorDetail struct { type Config struct { APIKey string BaseURL string + ProxyURL string Debug bool TLSConfig *tls.Config } @@ -62,6 +63,11 @@ func New(config Config) Client { baseURL = "https://api.newrelic.com/v2" } + proxyURL := config.ProxyURL + if proxyURL != "" { + r.SetProxy(proxyURL) + } + r.SetHeader("X-Api-Key", config.APIKey) r.SetHostURL(baseURL)