adapters

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 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(metadata *C.Metadata) (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 Fallback

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

func NewFallback

func NewFallback(option FallbackOption, proxies []C.Proxy) (*Fallback, error)

func (*Fallback) Close

func (f *Fallback) Close()

func (*Fallback) Generator

func (f *Fallback) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter, err error)

func (*Fallback) Name

func (f *Fallback) Name() string

func (*Fallback) Now

func (f *Fallback) Now() string

func (*Fallback) Type

func (f *Fallback) Type() C.AdapterType

type FallbackOption

type FallbackOption struct {
	Name     string   `proxy:"name"`
	Proxies  []string `proxy:"proxies"`
	URL      string   `proxy:"url"`
	Interval int      `proxy:"interval"`
}

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(metadata *C.Metadata) (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(metadata *C.Metadata) (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 SelectorOption

type SelectorOption struct {
	Name    string   `proxy:"name"`
	Proxies []string `proxy:"proxies"`
}

type ShadowSocks

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

func NewShadowSocks

func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error)

func (*ShadowSocks) Generator

func (ss *ShadowSocks) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter, err error)

func (*ShadowSocks) Name

func (ss *ShadowSocks) Name() string

func (*ShadowSocks) Type

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

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"`
	Obfs     string `proxy:"obfs,omitempty"`
	ObfsHost string `proxy:"obfs-host,omitempty"`
}

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(option Socks5Option) *Socks5

func (*Socks5) Generator

func (ss *Socks5) Generator(metadata *C.Metadata) (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 Socks5Option

type Socks5Option struct {
	Name   string `proxy:"name"`
	Server string `proxy:"server"`
	Port   int    `proxy:"port"`
}

type URLTest

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

func NewURLTest

func NewURLTest(option URLTestOption, proxies []C.Proxy) (*URLTest, error)

func (*URLTest) Close

func (u *URLTest) Close()

func (*URLTest) Generator

func (u *URLTest) Generator(metadata *C.Metadata) (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 URLTestOption

type URLTestOption struct {
	Name     string   `proxy:"name"`
	Proxies  []string `proxy:"proxies"`
	URL      string   `proxy:"url"`
	Interval int      `proxy:"interval"`
}

type Vmess

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

func NewVmess

func NewVmess(option VmessOption) (*Vmess, error)

func (*Vmess) Generator

func (ss *Vmess) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter, err error)

func (*Vmess) Name

func (ss *Vmess) Name() string

func (*Vmess) Type

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

type VmessAdapter

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

VmessAdapter is a vmess adapter

func (*VmessAdapter) Close

func (v *VmessAdapter) Close()

Close is used to close connection

func (*VmessAdapter) Conn

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

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"`
}

Jump to

Keyboard shortcuts

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