From 0d5759daedf62c168af92cc6447cefcb96770193 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Fri, 30 Mar 2018 11:10:49 -0700 Subject: [PATCH] Fix http_proxy variable name in http_response plugin --- plugins/inputs/http_response/README.md | 3 +++ plugins/inputs/http_response/http_response.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/http_response/README.md b/plugins/inputs/http_response/README.md index 127a4530b..69b477ed4 100644 --- a/plugins/inputs/http_response/README.md +++ b/plugins/inputs/http_response/README.md @@ -10,6 +10,9 @@ This input plugin checks HTTP/HTTPS connections. ## Server address (default http://localhost) # address = "http://localhost" + ## Set http_proxy (telegraf uses the system wide proxy settings if it's is not set) + # http_proxy = "http://localhost:8888" + ## Set response_timeout (default 5 seconds) # response_timeout = "5s" diff --git a/plugins/inputs/http_response/http_response.go b/plugins/inputs/http_response/http_response.go index b0f1009fc..9dcf9394a 100644 --- a/plugins/inputs/http_response/http_response.go +++ b/plugins/inputs/http_response/http_response.go @@ -22,7 +22,7 @@ import ( // HTTPResponse struct type HTTPResponse struct { Address string - Proxy string + HTTPProxy string `toml:"http_proxy"` Body string Method string ResponseTimeout internal.Duration @@ -120,7 +120,7 @@ func (h *HTTPResponse) createHttpClient() (*http.Client, error) { } client := &http.Client{ Transport: &http.Transport{ - Proxy: getProxyFunc(h.Proxy), + Proxy: getProxyFunc(h.HTTPProxy), DisableKeepAlives: true, TLSClientConfig: tlsCfg, },