Skip to content
Open
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
11 changes: 11 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,17 @@ func RunCLI(args []string, stdout io.Writer, stderr io.Writer, options CLIOption
TLSClientConfig: tlsConfig,
}

// If http_proxy is set, use that as the Transport Proxy
proxyStr, present := os.LookupEnv("http_proxy")
if present {
proxyURL, err := url.Parse(proxyStr)
if err != nil {
printError(stderr, fmt.Sprintf("rdap: Error: invalid proxy URL: %s", proxyURL))
return 1
}
transport.Proxy = http.ProxyURL(proxyURL)
}

// Setup http.RoundTripper for http clients
bs.HTTP = &http.Client{
Transport: transport,
Expand Down