Skip to content

[ENHANCEMENT] Update http client to use http.ProxyFromEnvironment #211

@johnlafata

Description

@johnlafata

Is it possible that the splunk-firehose-nozzle http client at:

https://github.com/cloudfoundry-community/splunk-firehose-nozzle/blob/031570d542440562bbe23e3444668e25e5b1a198/eventwriter/splunk.go#L34 [github.com]

could be modified to use the http.ProxyFromEnvironment reference, as shown here in another golang library used to communicate to Pivotal Network:

https://github.com/pivotal-cf/go-pivnet/issues/8 [github.com]

Basically, we are asking if this Snippet:

func NewSplunk(config *SplunkConfig) Writer {
		httpClient := cfhttp.NewClient()
		tr := &http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: config.SkipSSL},
		}
		httpClient.Transport = tr
	

		return &splunkClient{
			httpClient: httpClient,
			config:     config,
		}
	}

can be modified to use the http.ProxyFromEnvironment, similar to the following?

func NewSplunk(config *SplunkConfig) Writer {
		httpClient := cfhttp.NewClient()
		tr := &http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: config.SkipSSL},
			Proxy: http.ProxyFromEnvironment,
		}
		httpClient.Transport = tr
	

		return &splunkClient{
			httpClient: httpClient,
			config:     config,
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions