Documentation ¶
Index ¶
- type Proxy
- type ProxyConfig
- func (p *ProxyConfig) GetProxy(scope string, proto string, name string) (Proxy, error)
- func (p *ProxyConfig) GetScopeProxies(scope define.Scope) (ScopeProxies, error)
- func (p *ProxyConfig) LoadPxyCfg(path string) error
- func (p *ProxyConfig) SetScopeProxies(scope define.Scope, proxies ScopeProxies)
- func (p *ProxyConfig) WritePxyCfg(path string) error
- type ProxyNetwork
- type ProxyProto
- type ScopeProxies
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct { // proxy proto type ProtoType string `json:"type"` // http sock4 sock5 // [proto]&[name] as ident Name string `yaml:"name"` // proxy server Server string `yaml:"server"` Port int `yaml:"port"` // auth message UserName string `yaml:"username"` Password string `yaml:"password"` }
proxy type
type ProxyConfig ¶
type ProxyConfig struct {
AllProxies map[string]ScopeProxies `yaml:"all-proxies"` // map[global,app]ScopeProxies
}
proxy config
func (*ProxyConfig) GetProxy ¶
get proxy from config map, index: [global,app] -> [http,sock4,sock5] -> [proxy-name]
func (*ProxyConfig) GetScopeProxies ¶
func (p *ProxyConfig) GetScopeProxies(scope define.Scope) (ScopeProxies, error)
get proxy by scope
func (*ProxyConfig) LoadPxyCfg ¶
func (p *ProxyConfig) LoadPxyCfg(path string) error
load config file
func (*ProxyConfig) SetScopeProxies ¶
func (p *ProxyConfig) SetScopeProxies(scope define.Scope, proxies ScopeProxies)
func (*ProxyConfig) WritePxyCfg ¶
func (p *ProxyConfig) WritePxyCfg(path string) error
write config file
type ProxyNetwork ¶
type ProxyNetwork int
proxy proto, support tcp udp
const ( TcpProxy ProxyNetwork = iota UdpProxy )
func (ProxyNetwork) String ¶
func (p ProxyNetwork) String() string
type ProxyProto ¶
type ProxyProto int
proxy type, support HTTP SOCK4 SOCK5
const ( HttpProxy ProxyProto = iota Sock4Proxy Sock5Proxy )
func (ProxyProto) String ¶
func (p ProxyProto) String() string
type ScopeProxies ¶
type ScopeProxies struct { Proxies map[string][]Proxy `yaml:"proxies"` // map[http,sock4,sock5][]proxy // proxy setting ProxyProgram []string `yaml:"proxy-program"` // global proxy will ignore NoProxyProgram []string `yaml:"no-proxy-program"` // app proxy will ignore // white list WhiteList []string `yaml:"whitelist"` // white site dont use proxy, not use this time TPort int `yaml:"t-port"` DNSPort int `yaml:"dns-port"` UseFakeIP bool `yaml:"use-fake-ip"` }
scope proxy
func (*ScopeProxies) ClearProxy ¶
func (p *ScopeProxies) ClearProxy()
Click to show internal directories.
Click to hide internal directories.