Documentation ¶
Index ¶
- type Base
- type Direct
- type Fallback
- func (f *Fallback) Destroy()
- func (f *Fallback) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error)
- func (f *Fallback) DialUDP(metadata *C.Metadata) (C.PacketConn, net.Addr, error)
- func (f *Fallback) MarshalJSON() ([]byte, error)
- func (f *Fallback) Now() string
- func (f *Fallback) SupportUDP() bool
- type FallbackOption
- type Http
- type HttpOption
- type LoadBalance
- func (lb *LoadBalance) Destroy()
- func (lb *LoadBalance) DialContext(ctx context.Context, metadata *C.Metadata) (c C.Conn, err error)
- func (lb *LoadBalance) DialUDP(metadata *C.Metadata) (pc C.PacketConn, addr net.Addr, err error)
- func (lb *LoadBalance) MarshalJSON() ([]byte, error)
- func (lb *LoadBalance) SupportUDP() bool
- type LoadBalanceOption
- type NopConn
- func (rw *NopConn) Close() error
- func (rw *NopConn) LocalAddr() net.Addr
- func (rw *NopConn) Read(b []byte) (int, error)
- func (rw *NopConn) RemoteAddr() net.Addr
- func (rw *NopConn) SetDeadline(time.Time) error
- func (rw *NopConn) SetReadDeadline(time.Time) error
- func (rw *NopConn) SetWriteDeadline(time.Time) error
- func (rw *NopConn) Write(b []byte) (int, error)
- type Proxy
- func (p *Proxy) Alive() bool
- func (p *Proxy) DelayHistory() []C.DelayHistory
- func (p *Proxy) Dial(metadata *C.Metadata) (C.Conn, error)
- func (p *Proxy) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error)
- func (p *Proxy) LastDelay() (delay uint16)
- func (p *Proxy) MarshalJSON() ([]byte, error)
- func (p *Proxy) URLTest(ctx context.Context, url string) (t uint16, err error)
- type ProxyGroupOption
- type Reject
- type Selector
- func (s *Selector) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error)
- func (s *Selector) DialUDP(metadata *C.Metadata) (C.PacketConn, net.Addr, error)
- func (s *Selector) MarshalJSON() ([]byte, error)
- func (s *Selector) Now() string
- func (s *Selector) Set(name string) error
- func (s *Selector) SupportUDP() bool
- type SelectorOption
- type ShadowSocks
- type ShadowSocksOption
- type ShadowsocksR
- type ShadowsocksROption
- type Snell
- type SnellOption
- type Socks5
- type Socks5Option
- type URLTest
- func (u *URLTest) Destroy()
- func (u *URLTest) DialContext(ctx context.Context, metadata *C.Metadata) (c C.Conn, err error)
- func (u *URLTest) DialUDP(metadata *C.Metadata) (C.PacketConn, net.Addr, error)
- func (u *URLTest) MarshalJSON() ([]byte, error)
- func (u *URLTest) Now() string
- func (u *URLTest) SupportUDP() bool
- type URLTestOption
- type Vmess
- type VmessOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) MarshalJSON ¶
func (*Base) SupportUDP ¶
func (*Base) Type ¶
func (b *Base) Type() C.AdapterType
type Fallback ¶
type Fallback struct { *Base // contains filtered or unexported fields }
func NewFallback ¶
func NewFallback(option FallbackOption, proxies []C.Proxy) (*Fallback, error)
func (*Fallback) DialContext ¶
func (*Fallback) MarshalJSON ¶
func (*Fallback) SupportUDP ¶
type FallbackOption ¶
type Http ¶
type Http struct { *Base // contains filtered or unexported fields }
func NewHttp ¶
func NewHttp(option HttpOption) *Http
type HttpOption ¶
type LoadBalance ¶
type LoadBalance struct { *Base // contains filtered or unexported fields }
func NewLoadBalance ¶
func NewLoadBalance(option LoadBalanceOption, proxies []C.Proxy) (*LoadBalance, error)
func (*LoadBalance) Destroy ¶
func (lb *LoadBalance) Destroy()
func (*LoadBalance) DialContext ¶
func (*LoadBalance) DialUDP ¶
func (lb *LoadBalance) DialUDP(metadata *C.Metadata) (pc C.PacketConn, addr net.Addr, err error)
func (*LoadBalance) MarshalJSON ¶
func (lb *LoadBalance) MarshalJSON() ([]byte, error)
func (*LoadBalance) SupportUDP ¶
func (lb *LoadBalance) SupportUDP() bool
type LoadBalanceOption ¶
type NopConn ¶
type NopConn struct{}
func (*NopConn) RemoteAddr ¶
RemoteAddr is fake function for net.Conn
func (*NopConn) SetDeadline ¶
SetDeadline is fake function for net.Conn
func (*NopConn) SetReadDeadline ¶
SetReadDeadline is fake function for net.Conn
func (*NopConn) SetWriteDeadline ¶
SetWriteDeadline is fake function for net.Conn
type Proxy ¶
type Proxy struct { C.ProxyAdapter // contains filtered or unexported fields }
func NewProxy ¶
func NewProxy(adapter C.ProxyAdapter) *Proxy
func (*Proxy) DelayHistory ¶
func (p *Proxy) DelayHistory() []C.DelayHistory
func (*Proxy) DialContext ¶
func (*Proxy) LastDelay ¶
LastDelay return last history record. if proxy is not alive, return the max value of uint16.
func (*Proxy) MarshalJSON ¶
type ProxyGroupOption ¶
ProxyGroupOption contain the common options for all kind of ProxyGroup
type Selector ¶
type Selector struct { *Base // contains filtered or unexported fields }
func (*Selector) DialContext ¶
func (*Selector) MarshalJSON ¶
func (*Selector) SupportUDP ¶
type SelectorOption ¶
type ShadowSocks ¶
type ShadowSocks struct { *Base // contains filtered or unexported fields }
func NewShadowSocks ¶
func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error)
func (*ShadowSocks) DialContext ¶
func (*ShadowSocks) DialUDP ¶
func (ss *ShadowSocks) DialUDP(metadata *C.Metadata) (C.PacketConn, net.Addr, error)
func (*ShadowSocks) MarshalJSON ¶
func (ss *ShadowSocks) MarshalJSON() ([]byte, error)
type ShadowSocksOption ¶
type ShadowSocksOption struct { Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Password string `proxy:"password"` Cipher string `proxy:"cipher"` UDP bool `proxy:"udp,omitempty"` Plugin string `proxy:"plugin,omitempty"` PluginOpts map[string]interface{} `proxy:"plugin-opts,omitempty"` // deprecated when bump to 1.0 Obfs string `proxy:"obfs,omitempty"` ObfsHost string `proxy:"obfs-host,omitempty"` }
type ShadowsocksR ¶
type ShadowsocksR struct { *Base ObfsData interface{} ProtocolData interface{} // contains filtered or unexported fields }
func NewShadowsocksR ¶
func NewShadowsocksR(ssrop ShadowsocksROption) (*ShadowsocksR, error)
func (*ShadowsocksR) DialContext ¶
func (*ShadowsocksR) DialUDP ¶
func (ssr *ShadowsocksR) DialUDP(metadata *C.Metadata) (pac C.PacketConn, netaddr net.Addr, err error)
func (*ShadowsocksR) MarshalJSON ¶
func (ssr *ShadowsocksR) MarshalJSON() ([]byte, error)
type ShadowsocksROption ¶
type ShadowsocksROption struct { Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Password string `proxy:"password"` Cipher string `proxy:"cipher"` Protocol string `proxy:"protocol"` ProtocolParam string `proxy:"protocolparam"` Obfs string `proxy:"obfs"` ObfsParam string `proxy:"obfsparam"` }
type Snell ¶
type Snell struct { *Base // contains filtered or unexported fields }
func NewSnell ¶
func NewSnell(option SnellOption) (*Snell, error)
type SnellOption ¶
type Socks5 ¶
type Socks5 struct { *Base // contains filtered or unexported fields }
func NewSocks5 ¶
func NewSocks5(option Socks5Option) *Socks5
func (*Socks5) DialContext ¶
type Socks5Option ¶
type Socks5Option struct { Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` UserName string `proxy:"username,omitempty"` Password string `proxy:"password,omitempty"` TLS bool `proxy:"tls,omitempty"` UDP bool `proxy:"udp,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` }
type URLTest ¶
type URLTest struct { *Base // contains filtered or unexported fields }
func NewURLTest ¶
func NewURLTest(option URLTestOption, proxies []C.Proxy) (*URLTest, error)
func (*URLTest) DialContext ¶
func (*URLTest) MarshalJSON ¶
func (*URLTest) SupportUDP ¶
type URLTestOption ¶
type Vmess ¶
type Vmess struct { *Base // contains filtered or unexported fields }
func NewVmess ¶
func NewVmess(option VmessOption) (*Vmess, error)
func (*Vmess) DialContext ¶
type VmessOption ¶
type VmessOption struct { Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` UUID string `proxy:"uuid"` AlterID int `proxy:"alterId"` Cipher string `proxy:"cipher"` TLS bool `proxy:"tls,omitempty"` UDP bool `proxy:"udp,omitempty"` Network string `proxy:"network,omitempty"` WSPath string `proxy:"ws-path,omitempty"` WSHeaders map[string]string `proxy:"ws-headers,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` }
Click to show internal directories.
Click to hide internal directories.