Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support proxy CONNECT headers #1147

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions js/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func (r *Runner) newVU(samplesOut chan<- stats.SampleContainer) (*VU, error) {
DisableKeepAlives: r.Bundle.Options.NoConnectionReuse.Bool,
MaxIdleConns: int(r.Bundle.Options.Batch.Int64),
MaxIdleConnsPerHost: int(r.Bundle.Options.BatchPerHost.Int64),
ProxyConnectHeader: r.Bundle.Options.ProxyHeaders,
}
_ = http2.ConfigureTransport(transport)

Expand Down
8 changes: 8 additions & 0 deletions lib/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"encoding/json"
"fmt"
"net"
"net/http"
"reflect"
"strings"

Expand Down Expand Up @@ -337,6 +338,9 @@ type Options struct {

// Redirect console logging to a file
ConsoleOutput null.String `json:"-" envconfig:"console_output"`

// Proxy CONNECT headers
ProxyHeaders http.Header `json:"proxyHeaders" envconfig:"proxy_headers"`
}

// Returns the result of overwriting any fields with any that are set on the argument.
Expand Down Expand Up @@ -481,6 +485,10 @@ func (o Options) Apply(opts Options) Options {
o.ConsoleOutput = opts.ConsoleOutput
}

if opts.ProxyHeaders != nil {
o.ProxyHeaders = opts.ProxyHeaders
}

return o
}

Expand Down