Documentation
¶
Index ¶
- func NewConn(c net.Conn, a C.ProxyAdapter) C.Conn
- type Base
- func (b *Base) Addr() string
- func (b *Base) DialUDP(metadata *C.Metadata) (C.PacketConn, error)
- func (b *Base) MarshalJSON() ([]byte, error)
- func (b *Base) Name() string
- func (b *Base) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (b *Base) SupportUDP() bool
- func (b *Base) Type() C.AdapterType
- func (b *Base) Unwrap(metadata *C.Metadata) C.Proxy
- type Direct
- type GrpcOptions
- type HTTP2Options
- type HTTPOptions
- type Http
- type HttpOption
- 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 Reject
- type ShadowSocks
- type ShadowSocksOption
- type ShadowSocksR
- type ShadowSocksROption
- type Snell
- type SnellOption
- type Socks5
- type Socks5Option
- type Trojan
- type TrojanOption
- type Vmess
- type VmessOption
- type WSOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) MarshalJSON ¶
MarshalJSON implements C.ProxyAdapter
func (*Base) StreamConn ¶
StreamConn implements C.ProxyAdapter
type Direct ¶
type Direct struct {
*Base
}
func (*Direct) DialContext ¶
DialContext implements C.ProxyAdapter
type GrpcOptions ¶
type GrpcOptions struct {
GrpcServiceName string `proxy:"grpc-service-name,omitempty"`
}
type HTTP2Options ¶
type HTTPOptions ¶
type Http ¶
type Http struct {
*Base
// contains filtered or unexported fields
}
func NewHttp ¶
func NewHttp(option HttpOption) *Http
func (*Http) DialContext ¶
DialContext implements C.ProxyAdapter
type HttpOption ¶
type HttpOption 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"`
SNI string `proxy:"sni,omitempty"`
SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"`
}
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 Reject ¶
type Reject struct {
*Base
}
func (*Reject) DialContext ¶
DialContext implements C.ProxyAdapter
type ShadowSocks ¶
type ShadowSocks struct {
*Base
// contains filtered or unexported fields
}
func NewShadowSocks ¶
func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error)
func (*ShadowSocks) DialContext ¶
DialContext implements C.ProxyAdapter
func (*ShadowSocks) DialUDP ¶
func (ss *ShadowSocks) DialUDP(metadata *C.Metadata) (C.PacketConn, error)
DialUDP implements C.ProxyAdapter
func (*ShadowSocks) StreamConn ¶
StreamConn implements C.ProxyAdapter
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"`
}
type ShadowSocksR ¶
type ShadowSocksR struct {
*Base
// contains filtered or unexported fields
}
func NewShadowSocksR ¶
func NewShadowSocksR(option ShadowSocksROption) (*ShadowSocksR, error)
func (*ShadowSocksR) DialContext ¶
func (ssr *ShadowSocksR) DialContext(ctx context.Context, metadata *C.Metadata) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*ShadowSocksR) DialUDP ¶
func (ssr *ShadowSocksR) DialUDP(metadata *C.Metadata) (C.PacketConn, error)
DialUDP implements C.ProxyAdapter
func (*ShadowSocksR) StreamConn ¶
StreamConn implements C.ProxyAdapter
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"`
Obfs string `proxy:"obfs"`
ObfsParam string `proxy:"obfs-param,omitempty"`
Protocol string `proxy:"protocol"`
ProtocolParam string `proxy:"protocol-param,omitempty"`
UDP bool `proxy:"udp,omitempty"`
}
type Snell ¶
type Snell struct {
*Base
// contains filtered or unexported fields
}
func NewSnell ¶
func NewSnell(option SnellOption) (*Snell, error)
func (*Snell) DialContext ¶
DialContext implements C.ProxyAdapter
type SnellOption ¶
type Socks5 ¶
type Socks5 struct {
*Base
// contains filtered or unexported fields
}
func NewSocks5 ¶
func NewSocks5(option Socks5Option) *Socks5
func (*Socks5) DialContext ¶
DialContext implements C.ProxyAdapter
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 Trojan ¶
type Trojan struct {
*Base
// contains filtered or unexported fields
}
func NewTrojan ¶
func NewTrojan(option TrojanOption) (*Trojan, error)
func (*Trojan) DialContext ¶
DialContext implements C.ProxyAdapter
type TrojanOption ¶
type TrojanOption struct {
Name string `proxy:"name"`
Server string `proxy:"server"`
Port int `proxy:"port"`
Password string `proxy:"password"`
ALPN []string `proxy:"alpn,omitempty"`
SNI string `proxy:"sni,omitempty"`
SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"`
UDP bool `proxy:"udp,omitempty"`
Network string `proxy:"network,omitempty"`
GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"`
}
type Vmess ¶
type Vmess struct {
*Base
// contains filtered or unexported fields
}
func NewVmess ¶
func NewVmess(option VmessOption) (*Vmess, error)
func (*Vmess) DialContext ¶
DialContext implements C.ProxyAdapter
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"`
HTTPOpts HTTPOptions `proxy:"http-opts,omitempty"`
HTTP2Opts HTTP2Options `proxy:"h2-opts,omitempty"`
GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"`
WSOpts WSOptions `proxy:"ws-opts,omitempty"`
WSPath string `proxy:"ws-path,omitempty"`
WSHeaders map[string]string `proxy:"ws-headers,omitempty"`
SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"`
ServerName string `proxy:"servername,omitempty"`
}