Home | History | Annotate | Download | only in http

Lines Matching refs:Proxy

32 	"golang_org/x/net/proxy"
41 Proxy: ProxyFromEnvironment,
77 // The Transport will send CONNECT requests to a proxy for its own use
98 // Proxy specifies a function to return a proxy for a given
102 // The proxy type is determined by the URL scheme. "http"
106 // If Proxy is nil or returns a nil *URL, no proxy is used.
107 Proxy func(*Request) (*url.URL, error)
259 // ProxyFromEnvironment returns the URL of the proxy to use for a
269 // A nil URL and nil error are returned if no proxy is defined in the
270 // environment, or a proxy should not be used for the given request,
276 var proxy string
278 proxy = httpsProxyEnv.Get()
280 if proxy == "" {
281 proxy = httpProxyEnv.Get()
282 if proxy != "" && os.Getenv("REQUEST_METHOD") != "" {
286 if proxy == "" {
292 proxyURL, err := url.Parse(proxy)
297 // proxy was bogus. Try prepending "http://" to it and
300 if proxyURL, err := url.Parse("http://" + proxy); err == nil {
306 return nil, fmt.Errorf("invalid proxy address %q: %v", proxy, err)
311 // ProxyURL returns a proxy function (for use in a Transport)
406 // host (for http or https), the http proxy, or the http proxy
624 if t.Proxy != nil {
625 cm.proxyURL, err = t.Proxy(treq.Request)
628 return cm, fmt.Errorf("invalid proxy URL port %q", port)
635 // proxyAuth returns the Proxy-Authorization header to set
911 // specified in the connectMethod. This includes doing a proxy CONNECT
1018 func newOneConnDialer(c net.Conn) proxy.Dialer {
1159 // Proxy setup.
1162 // Do nothing. Not using a proxy.
1165 var auth *proxy.Auth
1167 auth = &proxy.Auth{}
1171 p, err := proxy.SOCKS5("", cm.addr(), auth, newOneConnDialer(conn))
1184 h.Set("Proxy-Authorization", pa)
1200 connectReq.Header.Set("Proxy-Authorization", pa)
1258 // useProxy reports whether requests to addr should use a proxy,
1322 // |http|foo.com http directly to server, no proxy
1323 // |https|foo.com https directly to server, no proxy
1324 // http://proxy.com|https|foo.com http to proxy, then CONNECT to foo.com
1325 // http://proxy.com|http http to proxy, http to anywhere after that
1326 // socks5://proxy.com|http|foo.com socks5 to proxy, then http to foo.com
1327 // socks5://proxy.com|https|foo.com socks5 to proxy, then https to foo.com
1328 // https://proxy.com|https|foo.com https to proxy, then CONNECT to foo.com
1329 // https://proxy.com|http https to proxy, http to anywhere after that
1332 proxyURL *url.URL // nil for no proxy, else full proxy URL
1334 // If proxyURL specifies an http or https proxy, and targetScheme is http (not https),
1350 proxy: proxyStr,
1383 // stringified proxy URL (or the empty string) instead of a pointer to
1386 proxy, scheme, addr string
1391 return fmt.Sprintf("%s|%s|%s", k.proxy, k.scheme, k.addr)