Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = ProxyConfig{}
Functions ¶
This section is empty.
Types ¶
type ProxyConfig ¶
type ProxyConfig struct {
// contains filtered or unexported fields
}
ProxyConfig stores the proxy settings that should be used for web requests made from this process.
func (*ProxyConfig) GetProxy ¶
GetProxy returns the URL of the proxy to use for a given request as indicated by the proxy settings. It behaves the same as the net/http.ProxyFromEnvironment function, except that it uses the stored settings rather than pulling the configuration from environment variables. (The implementation is copied from net/http.ProxyFromEnvironment.)
func (*ProxyConfig) InstallInDefaultTransport ¶
func (pc *ProxyConfig) InstallInDefaultTransport() error
InstallInDefaultTransport sets the proxy resolution used by the default HTTP transport to use the proxy details stored in this ProxyConfig. Requests made without an explicit transport will respect these proxy settings.
func (*ProxyConfig) Set ¶
func (pc *ProxyConfig) Set(newSettings proxyutils.Settings) error
Set updates the stored settings to the new ones passed in.