adapters

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelayTest

func DelayTest(proxy C.Proxy, url string) (t int16, err error)

DelayTest get the delay for the specified URL

Types

type Direct

type Direct struct{}

func NewDirect

func NewDirect() *Direct

func (*Direct) Generator

func (d *Direct) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*Direct) Name

func (d *Direct) Name() string

func (*Direct) Type

func (d *Direct) Type() C.AdapterType

type DirectAdapter

type DirectAdapter struct {
	// contains filtered or unexported fields
}

DirectAdapter is a directly connected adapter

func (*DirectAdapter) Close

func (d *DirectAdapter) Close()

Close is used to close connection

func (*DirectAdapter) Conn

func (d *DirectAdapter) Conn() net.Conn

Conn is used to http request

type NopConn

type NopConn struct{}

func (*NopConn) Close

func (rw *NopConn) Close() error

Close is fake function for net.Conn

func (*NopConn) LocalAddr

func (rw *NopConn) LocalAddr() net.Addr

LocalAddr is fake function for net.Conn

func (*NopConn) Read

func (rw *NopConn) Read(b []byte) (int, error)

func (*NopConn) RemoteAddr

func (rw *NopConn) RemoteAddr() net.Addr

RemoteAddr is fake function for net.Conn

func (*NopConn) SetDeadline

func (rw *NopConn) SetDeadline(time.Time) error

SetDeadline is fake function for net.Conn

func (*NopConn) SetReadDeadline

func (rw *NopConn) SetReadDeadline(time.Time) error

SetReadDeadline is fake function for net.Conn

func (*NopConn) SetWriteDeadline

func (rw *NopConn) SetWriteDeadline(time.Time) error

SetWriteDeadline is fake function for net.Conn

func (*NopConn) Write

func (rw *NopConn) Write(b []byte) (int, error)

type Reject

type Reject struct {
}

func NewReject

func NewReject() *Reject

func (*Reject) Generator

func (r *Reject) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*Reject) Name

func (r *Reject) Name() string

func (*Reject) Type

func (r *Reject) Type() C.AdapterType

type RejectAdapter

type RejectAdapter struct {
	// contains filtered or unexported fields
}

RejectAdapter is a reject connected adapter

func (*RejectAdapter) Close

func (r *RejectAdapter) Close()

Close is used to close connection

func (*RejectAdapter) Conn

func (r *RejectAdapter) Conn() net.Conn

Conn is used to http request

type Selector

type Selector struct {
	// contains filtered or unexported fields
}

func NewSelector

func NewSelector(name string, proxies map[string]C.Proxy) (*Selector, error)

func (*Selector) All

func (s *Selector) All() []string

func (*Selector) Generator

func (s *Selector) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*Selector) Name

func (s *Selector) Name() string

func (*Selector) Now

func (s *Selector) Now() string

func (*Selector) Set

func (s *Selector) Set(name string) error

func (*Selector) Type

func (s *Selector) Type() C.AdapterType

type ShadowSocks

type ShadowSocks struct {
	// contains filtered or unexported fields
}

func NewShadowSocks

func NewShadowSocks(name string, ssURL string, option map[string]string) (*ShadowSocks, error)

func (*ShadowSocks) Generator

func (ss *ShadowSocks) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*ShadowSocks) Name

func (ss *ShadowSocks) Name() string

func (*ShadowSocks) Type

func (ss *ShadowSocks) Type() C.AdapterType

type ShadowsocksAdapter

type ShadowsocksAdapter struct {
	// contains filtered or unexported fields
}

ShadowsocksAdapter is a shadowsocks adapter

func (*ShadowsocksAdapter) Close

func (ss *ShadowsocksAdapter) Close()

Close is used to close connection

func (*ShadowsocksAdapter) Conn

func (ss *ShadowsocksAdapter) Conn() net.Conn

type Socks5

type Socks5 struct {
	// contains filtered or unexported fields
}

func NewSocks5

func NewSocks5(name, addr string) *Socks5

func (*Socks5) Generator

func (ss *Socks5) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*Socks5) Name

func (ss *Socks5) Name() string

func (*Socks5) Type

func (ss *Socks5) Type() C.AdapterType

type Socks5Adapter

type Socks5Adapter struct {
	// contains filtered or unexported fields
}

Socks5Adapter is a shadowsocks adapter

func (*Socks5Adapter) Close

func (ss *Socks5Adapter) Close()

Close is used to close connection

func (*Socks5Adapter) Conn

func (ss *Socks5Adapter) Conn() net.Conn

type URLTest

type URLTest struct {
	// contains filtered or unexported fields
}

func NewURLTest

func NewURLTest(name string, proxies []C.Proxy, rawURL string, delay time.Duration) (*URLTest, error)

func (*URLTest) Close

func (u *URLTest) Close()

func (*URLTest) Generator

func (u *URLTest) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*URLTest) Name

func (u *URLTest) Name() string

func (*URLTest) Now

func (u *URLTest) Now() string

func (*URLTest) Type

func (u *URLTest) Type() C.AdapterType

type Vmess added in v0.7.0

type Vmess struct {
	// contains filtered or unexported fields
}

func NewVmess added in v0.7.0

func NewVmess(name string, server string, uuid string, alterID uint16, security string, option map[string]string) (*Vmess, error)

func (*Vmess) Generator added in v0.7.0

func (ss *Vmess) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error)

func (*Vmess) Name added in v0.7.0

func (ss *Vmess) Name() string

func (*Vmess) Type added in v0.7.0

func (ss *Vmess) Type() C.AdapterType

type VmessAdapter added in v0.7.0

type VmessAdapter struct {
	// contains filtered or unexported fields
}

VmessAdapter is a vmess adapter

func (*VmessAdapter) Close added in v0.7.0

func (v *VmessAdapter) Close()

Close is used to close connection

func (*VmessAdapter) Conn added in v0.7.0

func (v *VmessAdapter) Conn() net.Conn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL