Fix http_proxy variable name in http_response plugin
This commit is contained in:
parent
666f757ae3
commit
0d5759daed
|
@ -10,6 +10,9 @@ This input plugin checks HTTP/HTTPS connections.
|
||||||
## Server address (default http://localhost)
|
## Server address (default http://localhost)
|
||||||
# address = "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)
|
## Set response_timeout (default 5 seconds)
|
||||||
# response_timeout = "5s"
|
# response_timeout = "5s"
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import (
|
||||||
// HTTPResponse struct
|
// HTTPResponse struct
|
||||||
type HTTPResponse struct {
|
type HTTPResponse struct {
|
||||||
Address string
|
Address string
|
||||||
Proxy string
|
HTTPProxy string `toml:"http_proxy"`
|
||||||
Body string
|
Body string
|
||||||
Method string
|
Method string
|
||||||
ResponseTimeout internal.Duration
|
ResponseTimeout internal.Duration
|
||||||
|
@ -120,7 +120,7 @@ func (h *HTTPResponse) createHttpClient() (*http.Client, error) {
|
||||||
}
|
}
|
||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
Proxy: getProxyFunc(h.Proxy),
|
Proxy: getProxyFunc(h.HTTPProxy),
|
||||||
DisableKeepAlives: true,
|
DisableKeepAlives: true,
|
||||||
TLSClientConfig: tlsCfg,
|
TLSClientConfig: tlsCfg,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue