Home | History | Annotate | Download | only in http

Lines Matching refs:Proxy

40 	Proxy: ProxyFromEnvironment,
88 // Proxy specifies a function to return a proxy for a given
91 // If Proxy is nil or returns a nil *URL, no proxy is used.
92 Proxy func(*Request) (*url.URL, error)
244 // ProxyFromEnvironment returns the URL of the proxy to use for a
254 // A nil URL and nil error are returned if no proxy is defined in the
255 // environment, or a proxy should not be used for the given request,
261 var proxy string
263 proxy = httpsProxyEnv.Get()
265 if proxy == "" {
266 proxy = httpProxyEnv.Get()
267 if proxy != "" && os.Getenv("REQUEST_METHOD") != "" {
271 if proxy == "" {
277 proxyURL, err := url.Parse(proxy)
279 // proxy was bogus. Try prepending "http://" to it and
282 if proxyURL, err := url.Parse("http://" + proxy); err == nil {
287 return nil, fmt.Errorf("invalid proxy address %q: %v", proxy, err)
292 // ProxyURL returns a proxy function (for use in a Transport)
375 // host (for http or https), the http proxy, or the http proxy
580 if t.Proxy != nil {
581 cm.proxyURL, err = t.Proxy(treq.Request)
584 return cm, fmt.Errorf("invalid proxy URL port %q", port)
591 // proxyAuth returns the Proxy-Authorization header to set
862 // specified in the connectMethod. This includes doing a proxy CONNECT
1019 // Proxy setup.
1022 // Do nothing. Not using a proxy.
1027 h.Set("Proxy-Authorization", pa)
1043 connectReq.Header.Set("Proxy-Authorization", pa)
1138 // useProxy reports whether requests to addr should use a proxy,
1198 // |http|foo.com http directly to server, no proxy
1199 // |https|foo.com https directly to server, no proxy
1200 // http://proxy.com|https|foo.com http to proxy, then CONNECT to foo.com
1201 // http://proxy.com|http http to proxy, http to anywhere after that
1203 // Note: no support to https to the proxy yet.
1206 proxyURL *url.URL // nil for no proxy, else full proxy URL
1208 targetAddr string // Not used if proxy + http targetScheme (4th example in table)
1221 proxy: proxyStr,
1246 // stringified proxy URL (or the empty string) instead of a pointer to
1249 proxy, scheme, addr string
1254 return fmt.Sprintf("%s|%s|%s", k.proxy, k.scheme, k.addr)