Documentation ¶
Index ¶
- Constants
- Variables
- func ArraiExists(arr []string, o string) bool
- func ChooiceOne(array []interface{}) interface{}
- func NewProxyDialer(proxyObj interface{}) (dialer proxy.Dialer)
- func NewProxyHttpClient(proxy interface{}, timeout ...int) (client *http.Client)
- func Socks5Dialer(addr string) proxy.Dialer
- type Dialer
- type ProgressBar
- type ProxyDialer
- type ProxyPool
- func (proxyPool *ProxyPool) Add(url string)
- func (proxyPool *ProxyPool) Adds(urls []string)
- func (proxyPool *ProxyPool) Count() int
- func (proxyPool *ProxyPool) Empty() bool
- func (pool *ProxyPool) Get() (outuri string)
- func (pool *ProxyPool) LoopOneTurn(doWhat func(proxyDialer Dialer) interface{}, processor ...ProgressBar) (o map[string]interface{})
- func (pool *ProxyPool) Merge(ppool ProxyPool)
- func (proxyPool *ProxyPool) Urls() (urls []string)
- type Result
Constants ¶
View Source
const ( Random = 1 Flow = 0 )
Variables ¶
View Source
var ( ParseOrder = config.ParseOrding ParseUri = func(uri string) (cfg config.Config, err error) { if strings.HasPrefix(uri, "vmess://") { return config.ParseVmessUri(uri) } else if strings.HasPrefix(uri, "ss") { return config.ParseSSUri(uri) } else { return cfg, errors.New("Invalid uri:" + uri) } } MustParseUri = func(uri string) (cfg config.Config) { var e error if strings.HasPrefix(uri, "vmess://") { cfg, e = config.ParseVmessUri(uri) } else if strings.HasPrefix(uri, "ss") { cfg, e = config.ParseSSUri(uri) } else { return cfg } if e != nil { log.Fatal("parse uri:", e, uri) } return cfg } )
View Source
var (
DefaultProxyPool = NewProxyPool()
)
View Source
var (
DefaultTimeout = 12
)
View Source
var (
OrderHistory = map[string]*ProxyPool{}
)
Functions ¶
func ArraiExists ¶
func ChooiceOne ¶
func ChooiceOne(array []interface{}) interface{}
func NewProxyDialer ¶
func NewProxyHttpClient ¶
func Socks5Dialer ¶
Types ¶
type ProgressBar ¶
type ProxyDialer ¶
type ProxyDialer struct {
// contains filtered or unexported fields
}
func NewDialerByURI ¶
func NewDialerByURI(ssuri string) (dialer *ProxyDialer, err error)
func (*ProxyDialer) ProxyURI ¶
func (dialer *ProxyDialer) ProxyURI() string
func (*ProxyDialer) ToHttpClient ¶
func (proxy *ProxyDialer) ToHttpClient(timeout ...int) (client *http.Client)
type ProxyPool ¶
type ProxyPool struct { Mode int // contains filtered or unexported fields }
func NewProxyPool ¶
NewProxyPool can set mode pool.Mode = Random / pool.Mode = Flow (default is flow)
func (*ProxyPool) LoopOneTurn ¶
func (pool *ProxyPool) LoopOneTurn(doWhat func(proxyDialer Dialer) interface{}, processor ...ProgressBar) (o map[string]interface{})
Directories ¶
Path | Synopsis |
---|---|
shadowsocks
|
|
tools/leakybuf
Provides leaky buffer, based on the example in Effective Go.
|
Provides leaky buffer, based on the example in Effective Go. |
tools/socks
Package socks implements essential parts of SOCKS protocol.
|
Package socks implements essential parts of SOCKS protocol. |
Package ws implements a simple websocket client.
|
Package ws implements a simple websocket client. |
Click to show internal directories.
Click to hide internal directories.