proxy

package
v3.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultProxyCallback = http.ProxyFromEnvironment

DefaultProxyCallback is the default proxy callback function that reads from environment variables. http.ProxyFromEnvironment is cached on first call, so we can't use it for tests. When writing a test that uses t.Setenv for some proxy env var, call UseTestingProxyCallback.

Functions

func GetCallback

func GetCallback(proxy string, noProxy string) func(*http.Request) (*url.URL, error)

GetCallback returns the proxy callback function

func UpsertEnv

func UpsertEnv(cmd *exec.Cmd, proxy string, noProxy string) []string

UpsertEnv removes the existing proxy env variables and adds the custom proxy variables

func UseTestingProxyCallback added in v3.3.0

func UseTestingProxyCallback()

UseTestingProxyCallback sets the DefaultProxyCallback to use httpproxy.FromEnvironment. This is useful for tests that use t.Setenv to set proxy env variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL