Skip to content

Commit

Permalink
Fix http_proxy variable name in http_response plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed Mar 30, 2018
1 parent 666f757 commit 0d5759d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions plugins/inputs/http_response/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/http_response/http_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit 0d5759d

Please sign in to comment.