Source File
proxy.go
Belonging Package
golang.org/x/net/proxy
package proxy // import "golang.org/x/net/proxy"
import (
)
func () Dialer {
return FromEnvironmentUsing(Direct)
}
func ( Dialer) Dialer {
:= allProxyEnv.Get()
if len() == 0 {
return
}
, := url.Parse()
if != nil {
return
}
, := FromURL(, )
if != nil {
return
}
:= noProxyEnv.Get()
if len() == 0 {
return
}
:= NewPerHost(, )
.AddFromString()
return
}
if proxySchemes != nil {
if , := proxySchemes[.Scheme]; {
return (, )
}
}
return nil, errors.New("proxy: unknown scheme: " + .Scheme)
}
var (
allProxyEnv = &envOnce{
names: []string{"ALL_PROXY", "all_proxy"},
}
noProxyEnv = &envOnce{
names: []string{"NO_PROXY", "no_proxy"},
}
)
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |