juju: github.com/juju/juju/utils/proxy Index | Files

package proxy

import "github.com/juju/juju/utils/proxy"


Package Files



var DefaultConfig = ProxyConfig{}

type ProxyConfig Uses

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 Uses

func (pc *ProxyConfig) GetProxy(req *http.Request) (*url.URL, error)

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 Uses

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 Uses

func (pc *ProxyConfig) Set(newSettings proxyutils.Settings) error

Set updates the stored settings to the new ones passed in.

Package proxy imports 7 packages (graph) and is imported by 45 packages. Updated 2018-08-20. Refresh now. Tools for package owners.