protocol

package
v0.3.1-rc.6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_node_protocol_protocol_proto protoreflect.FileDescriptor

Functions

func ParseTLSConfig

func ParseTLSConfig(t *TlsConfig) *tls.Config

func RegisterProtocol

func RegisterProtocol[T isProtocol_Protocol](wrap func(T) WrapProxy)

Types

type Direct

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

func (*Direct) Descriptor deprecated

func (*Direct) Descriptor() ([]byte, []int)

Deprecated: Use Direct.ProtoReflect.Descriptor instead.

func (*Direct) ProtoMessage

func (*Direct) ProtoMessage()

func (*Direct) ProtoReflect

func (x *Direct) ProtoReflect() protoreflect.Message

func (*Direct) Reset

func (x *Direct) Reset()

func (*Direct) String

func (x *Direct) String() string

type Grpc

type Grpc struct {
	Tls *TlsConfig `protobuf:"bytes,1,opt,name=tls,proto3" json:"tls,omitempty"`
	// contains filtered or unexported fields
}

func (*Grpc) Descriptor deprecated

func (*Grpc) Descriptor() ([]byte, []int)

Deprecated: Use Grpc.ProtoReflect.Descriptor instead.

func (*Grpc) GetTls

func (x *Grpc) GetTls() *TlsConfig

func (*Grpc) ProtoMessage

func (*Grpc) ProtoMessage()

func (*Grpc) ProtoReflect

func (x *Grpc) ProtoReflect() protoreflect.Message

func (*Grpc) Reset

func (x *Grpc) Reset()

func (*Grpc) String

func (x *Grpc) String() string

type Http

type Http struct {
	User     string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*Http) Descriptor deprecated

func (*Http) Descriptor() ([]byte, []int)

Deprecated: Use Http.ProtoReflect.Descriptor instead.

func (*Http) GetPassword

func (x *Http) GetPassword() string

func (*Http) GetUser

func (x *Http) GetUser() string

func (*Http) ProtoMessage

func (*Http) ProtoMessage()

func (*Http) ProtoReflect

func (x *Http) ProtoReflect() protoreflect.Message

func (*Http) Reset

func (x *Http) Reset()

func (*Http) String

func (x *Http) String() string

type None

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

func (*None) Descriptor deprecated

func (*None) Descriptor() ([]byte, []int)

Deprecated: Use None.ProtoReflect.Descriptor instead.

func (*None) ProtoMessage

func (*None) ProtoMessage()

func (*None) ProtoReflect

func (x *None) ProtoReflect() protoreflect.Message

func (*None) Reset

func (x *None) Reset()

func (*None) String

func (x *None) String() string

type ObfsHttp

type ObfsHttp struct {
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Port string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"`
	// contains filtered or unexported fields
}

func (*ObfsHttp) Descriptor deprecated

func (*ObfsHttp) Descriptor() ([]byte, []int)

Deprecated: Use ObfsHttp.ProtoReflect.Descriptor instead.

func (*ObfsHttp) GetHost

func (x *ObfsHttp) GetHost() string

func (*ObfsHttp) GetPort

func (x *ObfsHttp) GetPort() string

func (*ObfsHttp) ProtoMessage

func (*ObfsHttp) ProtoMessage()

func (*ObfsHttp) ProtoReflect

func (x *ObfsHttp) ProtoReflect() protoreflect.Message

func (*ObfsHttp) Reset

func (x *ObfsHttp) Reset()

func (*ObfsHttp) String

func (x *ObfsHttp) String() string

type Protocol

type Protocol struct {

	// Types that are assignable to Protocol:
	//
	//	*Protocol_Shadowsocks
	//	*Protocol_Shadowsocksr
	//	*Protocol_Vmess
	//	*Protocol_Websocket
	//	*Protocol_Quic
	//	*Protocol_ObfsHttp
	//	*Protocol_Trojan
	//	*Protocol_Simple
	//	*Protocol_None
	//	*Protocol_Socks5
	//	*Protocol_Http
	//	*Protocol_Direct
	//	*Protocol_Reject
	//	*Protocol_Yuubinsya
	//	*Protocol_Grpc
	Protocol isProtocol_Protocol `protobuf_oneof:"protocol"`
	// contains filtered or unexported fields
}

func (*Protocol) Descriptor deprecated

func (*Protocol) Descriptor() ([]byte, []int)

Deprecated: Use Protocol.ProtoReflect.Descriptor instead.

func (*Protocol) GetDirect

func (x *Protocol) GetDirect() *Direct

func (*Protocol) GetGrpc

func (x *Protocol) GetGrpc() *Grpc

func (*Protocol) GetHttp

func (x *Protocol) GetHttp() *Http

func (*Protocol) GetNone

func (x *Protocol) GetNone() *None

func (*Protocol) GetObfsHttp

func (x *Protocol) GetObfsHttp() *ObfsHttp

func (*Protocol) GetProtocol

func (m *Protocol) GetProtocol() isProtocol_Protocol

func (*Protocol) GetQuic

func (x *Protocol) GetQuic() *Quic

func (*Protocol) GetReject

func (x *Protocol) GetReject() *Reject

func (*Protocol) GetShadowsocks

func (x *Protocol) GetShadowsocks() *Shadowsocks

func (*Protocol) GetShadowsocksr

func (x *Protocol) GetShadowsocksr() *Shadowsocksr

func (*Protocol) GetSimple

func (x *Protocol) GetSimple() *Simple

func (*Protocol) GetSocks5

func (x *Protocol) GetSocks5() *Socks5

func (*Protocol) GetTrojan

func (x *Protocol) GetTrojan() *Trojan

func (*Protocol) GetVmess

func (x *Protocol) GetVmess() *Vmess

func (*Protocol) GetWebsocket

func (x *Protocol) GetWebsocket() *Websocket

func (*Protocol) GetYuubinsya

func (x *Protocol) GetYuubinsya() *Yuubinsya

func (*Protocol) ProtoMessage

func (*Protocol) ProtoMessage()

func (*Protocol) ProtoReflect

func (x *Protocol) ProtoReflect() protoreflect.Message

func (*Protocol) Reset

func (x *Protocol) Reset()

func (*Protocol) String

func (x *Protocol) String() string

type Protocol_Direct

type Protocol_Direct struct {
	Direct *Direct `protobuf:"bytes,12,opt,name=direct,proto3,oneof"`
}

type Protocol_Grpc

type Protocol_Grpc struct {
	Grpc *Grpc `protobuf:"bytes,15,opt,name=grpc,proto3,oneof"`
}

type Protocol_Http

type Protocol_Http struct {
	Http *Http `protobuf:"bytes,11,opt,name=http,proto3,oneof"`
}

type Protocol_None

type Protocol_None struct {
	None *None `protobuf:"bytes,9,opt,name=none,proto3,oneof"`
}

type Protocol_ObfsHttp

type Protocol_ObfsHttp struct {
	ObfsHttp *ObfsHttp `protobuf:"bytes,6,opt,name=obfs_http,proto3,oneof"`
}

type Protocol_Quic

type Protocol_Quic struct {
	Quic *Quic `protobuf:"bytes,5,opt,name=quic,proto3,oneof"`
}

type Protocol_Reject

type Protocol_Reject struct {
	Reject *Reject `protobuf:"bytes,13,opt,name=reject,proto3,oneof"`
}

type Protocol_Shadowsocks

type Protocol_Shadowsocks struct {
	Shadowsocks *Shadowsocks `protobuf:"bytes,1,opt,name=shadowsocks,proto3,oneof"`
}

type Protocol_Shadowsocksr

type Protocol_Shadowsocksr struct {
	Shadowsocksr *Shadowsocksr `protobuf:"bytes,2,opt,name=shadowsocksr,proto3,oneof"`
}

type Protocol_Simple

type Protocol_Simple struct {
	Simple *Simple `protobuf:"bytes,8,opt,name=simple,proto3,oneof"`
}

type Protocol_Socks5

type Protocol_Socks5 struct {
	Socks5 *Socks5 `protobuf:"bytes,10,opt,name=socks5,proto3,oneof"`
}

type Protocol_Trojan

type Protocol_Trojan struct {
	Trojan *Trojan `protobuf:"bytes,7,opt,name=trojan,proto3,oneof"`
}

type Protocol_Vmess

type Protocol_Vmess struct {
	Vmess *Vmess `protobuf:"bytes,3,opt,name=vmess,proto3,oneof"`
}

type Protocol_Websocket

type Protocol_Websocket struct {
	Websocket *Websocket `protobuf:"bytes,4,opt,name=websocket,proto3,oneof"`
}

type Protocol_Yuubinsya

type Protocol_Yuubinsya struct {
	Yuubinsya *Yuubinsya `protobuf:"bytes,14,opt,name=yuubinsya,proto3,oneof"`
}

type Quic

type Quic struct {
	Host string     `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	Tls  *TlsConfig `protobuf:"bytes,1,opt,name=tls,proto3" json:"tls,omitempty"`
	// contains filtered or unexported fields
}

func (*Quic) Descriptor deprecated

func (*Quic) Descriptor() ([]byte, []int)

Deprecated: Use Quic.ProtoReflect.Descriptor instead.

func (*Quic) GetHost added in v0.3.3

func (x *Quic) GetHost() string

func (*Quic) GetTls

func (x *Quic) GetTls() *TlsConfig

func (*Quic) ProtoMessage

func (*Quic) ProtoMessage()

func (*Quic) ProtoReflect

func (x *Quic) ProtoReflect() protoreflect.Message

func (*Quic) Reset

func (x *Quic) Reset()

func (*Quic) String

func (x *Quic) String() string

type Reject

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

func (*Reject) Descriptor deprecated

func (*Reject) Descriptor() ([]byte, []int)

Deprecated: Use Reject.ProtoReflect.Descriptor instead.

func (*Reject) ProtoMessage

func (*Reject) ProtoMessage()

func (*Reject) ProtoReflect

func (x *Reject) ProtoReflect() protoreflect.Message

func (*Reject) Reset

func (x *Reject) Reset()

func (*Reject) String

func (x *Reject) String() string

type Shadowsocks

type Shadowsocks struct {
	Method   string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*Shadowsocks) Descriptor deprecated

func (*Shadowsocks) Descriptor() ([]byte, []int)

Deprecated: Use Shadowsocks.ProtoReflect.Descriptor instead.

func (*Shadowsocks) GetMethod

func (x *Shadowsocks) GetMethod() string

func (*Shadowsocks) GetPassword

func (x *Shadowsocks) GetPassword() string

func (*Shadowsocks) ProtoMessage

func (*Shadowsocks) ProtoMessage()

func (*Shadowsocks) ProtoReflect

func (x *Shadowsocks) ProtoReflect() protoreflect.Message

func (*Shadowsocks) Reset

func (x *Shadowsocks) Reset()

func (*Shadowsocks) String

func (x *Shadowsocks) String() string

type Shadowsocksr

type Shadowsocksr struct {
	Server     string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
	Port       string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"`
	Method     string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"`
	Password   string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	Obfs       string `protobuf:"bytes,5,opt,name=obfs,proto3" json:"obfs,omitempty"`
	Obfsparam  string `protobuf:"bytes,6,opt,name=obfsparam,proto3" json:"obfsparam,omitempty"`
	Protocol   string `protobuf:"bytes,7,opt,name=protocol,proto3" json:"protocol,omitempty"`
	Protoparam string `protobuf:"bytes,8,opt,name=protoparam,proto3" json:"protoparam,omitempty"`
	// contains filtered or unexported fields
}

func (*Shadowsocksr) Descriptor deprecated

func (*Shadowsocksr) Descriptor() ([]byte, []int)

Deprecated: Use Shadowsocksr.ProtoReflect.Descriptor instead.

func (*Shadowsocksr) GetMethod

func (x *Shadowsocksr) GetMethod() string

func (*Shadowsocksr) GetObfs

func (x *Shadowsocksr) GetObfs() string

func (*Shadowsocksr) GetObfsparam

func (x *Shadowsocksr) GetObfsparam() string

func (*Shadowsocksr) GetPassword

func (x *Shadowsocksr) GetPassword() string

func (*Shadowsocksr) GetPort

func (x *Shadowsocksr) GetPort() string

func (*Shadowsocksr) GetProtocol

func (x *Shadowsocksr) GetProtocol() string

func (*Shadowsocksr) GetProtoparam

func (x *Shadowsocksr) GetProtoparam() string

func (*Shadowsocksr) GetServer

func (x *Shadowsocksr) GetServer() string

func (*Shadowsocksr) ProtoMessage

func (*Shadowsocksr) ProtoMessage()

func (*Shadowsocksr) ProtoReflect

func (x *Shadowsocksr) ProtoReflect() protoreflect.Message

func (*Shadowsocksr) Reset

func (x *Shadowsocksr) Reset()

func (*Shadowsocksr) String

func (x *Shadowsocksr) String() string

type Simple

type Simple struct {
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Port int32  `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	// udp will write to every packet target instead of only write to host:port
	PacketConnDirect bool       `protobuf:"varint,3,opt,name=packet_conn_direct,proto3" json:"packet_conn_direct,omitempty"`
	Tls              *TlsConfig `protobuf:"bytes,4,opt,name=tls,proto3" json:"tls,omitempty"`
	// contains filtered or unexported fields
}

func (*Simple) Descriptor deprecated

func (*Simple) Descriptor() ([]byte, []int)

Deprecated: Use Simple.ProtoReflect.Descriptor instead.

func (*Simple) GetHost

func (x *Simple) GetHost() string

func (*Simple) GetPacketConnDirect

func (x *Simple) GetPacketConnDirect() bool

func (*Simple) GetPort

func (x *Simple) GetPort() int32

func (*Simple) GetTls

func (x *Simple) GetTls() *TlsConfig

func (*Simple) ProtoMessage

func (*Simple) ProtoMessage()

func (*Simple) ProtoReflect

func (x *Simple) ProtoReflect() protoreflect.Message

func (*Simple) Reset

func (x *Simple) Reset()

func (*Simple) String

func (x *Simple) String() string

type Socks5

type Socks5 struct {

	// eg: 127.0.0.1
	Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"`
	User     string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // TODO: add override hostname options
	// contains filtered or unexported fields
}

func (*Socks5) Descriptor deprecated

func (*Socks5) Descriptor() ([]byte, []int)

Deprecated: Use Socks5.ProtoReflect.Descriptor instead.

func (*Socks5) GetHostname

func (x *Socks5) GetHostname() string

func (*Socks5) GetPassword

func (x *Socks5) GetPassword() string

func (*Socks5) GetUser

func (x *Socks5) GetUser() string

func (*Socks5) ProtoMessage

func (*Socks5) ProtoMessage()

func (*Socks5) ProtoReflect

func (x *Socks5) ProtoReflect() protoreflect.Message

func (*Socks5) Reset

func (x *Socks5) Reset()

func (*Socks5) String

func (x *Socks5) String() string

type TlsConfig

type TlsConfig struct {
	Enable             bool     `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	ServerNames        []string `protobuf:"bytes,6,rep,name=server_names,json=servernames,proto3" json:"server_names,omitempty"`
	CaCert             [][]byte `protobuf:"bytes,3,rep,name=ca_cert,proto3" json:"ca_cert,omitempty"`
	InsecureSkipVerify bool     `protobuf:"varint,4,opt,name=insecure_skip_verify,proto3" json:"insecure_skip_verify,omitempty"`
	// next_protos ALPN Next Protocol
	// eg: h2, http/1.1
	NextProtos []string `protobuf:"bytes,5,rep,name=next_protos,proto3" json:"next_protos,omitempty"`
	// contains filtered or unexported fields
}

func (*TlsConfig) Descriptor deprecated

func (*TlsConfig) Descriptor() ([]byte, []int)

Deprecated: Use TlsConfig.ProtoReflect.Descriptor instead.

func (*TlsConfig) GetCaCert

func (x *TlsConfig) GetCaCert() [][]byte

func (*TlsConfig) GetEnable

func (x *TlsConfig) GetEnable() bool

func (*TlsConfig) GetInsecureSkipVerify

func (x *TlsConfig) GetInsecureSkipVerify() bool

func (*TlsConfig) GetNextProtos

func (x *TlsConfig) GetNextProtos() []string

func (*TlsConfig) GetServerNames

func (x *TlsConfig) GetServerNames() []string

func (*TlsConfig) ProtoMessage

func (*TlsConfig) ProtoMessage()

func (*TlsConfig) ProtoReflect

func (x *TlsConfig) ProtoReflect() protoreflect.Message

func (*TlsConfig) Reset

func (x *TlsConfig) Reset()

func (*TlsConfig) String

func (x *TlsConfig) String() string

type Trojan

type Trojan struct {
	Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
	Peer     string `protobuf:"bytes,2,opt,name=peer,proto3" json:"peer,omitempty"`
	// contains filtered or unexported fields
}

func (*Trojan) Descriptor deprecated

func (*Trojan) Descriptor() ([]byte, []int)

Deprecated: Use Trojan.ProtoReflect.Descriptor instead.

func (*Trojan) GetPassword

func (x *Trojan) GetPassword() string

func (*Trojan) GetPeer

func (x *Trojan) GetPeer() string

func (*Trojan) ProtoMessage

func (*Trojan) ProtoMessage()

func (*Trojan) ProtoReflect

func (x *Trojan) ProtoReflect() protoreflect.Message

func (*Trojan) Reset

func (x *Trojan) Reset()

func (*Trojan) String

func (x *Trojan) String() string

type Vmess

type Vmess struct {

	// uuid
	Uuid string `protobuf:"bytes,1,opt,name=uuid,json=id,proto3" json:"uuid,omitempty"`
	// alter id
	AlterId  string `protobuf:"bytes,2,opt,name=alter_id,json=aid,proto3" json:"alter_id,omitempty"`
	Security string `protobuf:"bytes,3,opt,name=security,proto3" json:"security,omitempty"`
	// contains filtered or unexported fields
}

func (*Vmess) Descriptor deprecated

func (*Vmess) Descriptor() ([]byte, []int)

Deprecated: Use Vmess.ProtoReflect.Descriptor instead.

func (*Vmess) GetAlterId

func (x *Vmess) GetAlterId() string

func (*Vmess) GetSecurity

func (x *Vmess) GetSecurity() string

func (*Vmess) GetUuid

func (x *Vmess) GetUuid() string

func (*Vmess) ProtoMessage

func (*Vmess) ProtoMessage()

func (*Vmess) ProtoReflect

func (x *Vmess) ProtoReflect() protoreflect.Message

func (*Vmess) Reset

func (x *Vmess) Reset()

func (*Vmess) String

func (x *Vmess) String() string

type Websocket

type Websocket struct {
	Host       string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Path       string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	TlsEnabled bool   `protobuf:"varint,4,opt,name=tls_enabled,proto3" json:"tls_enabled,omitempty"`
	// contains filtered or unexported fields
}

func (*Websocket) Descriptor deprecated

func (*Websocket) Descriptor() ([]byte, []int)

Deprecated: Use Websocket.ProtoReflect.Descriptor instead.

func (*Websocket) GetHost

func (x *Websocket) GetHost() string

func (*Websocket) GetPath

func (x *Websocket) GetPath() string

func (*Websocket) GetTlsEnabled

func (x *Websocket) GetTlsEnabled() bool

func (*Websocket) ProtoMessage

func (*Websocket) ProtoMessage()

func (*Websocket) ProtoReflect

func (x *Websocket) ProtoReflect() protoreflect.Message

func (*Websocket) Reset

func (x *Websocket) Reset()

func (*Websocket) String

func (x *Websocket) String() string

type WrapProxy

type WrapProxy func(p proxy.Proxy) (proxy.Proxy, error)

func ErrConn

func ErrConn(err error) WrapProxy

func Wrap

func Wrap(p isProtocol_Protocol) WrapProxy

type Yuubinsya

type Yuubinsya struct {
	Password  string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"`
	Encrypted bool   `protobuf:"varint,2,opt,name=encrypted,proto3" json:"encrypted,omitempty"`
	// contains filtered or unexported fields
}

func (*Yuubinsya) Descriptor deprecated

func (*Yuubinsya) Descriptor() ([]byte, []int)

Deprecated: Use Yuubinsya.ProtoReflect.Descriptor instead.

func (*Yuubinsya) GetEncrypted

func (x *Yuubinsya) GetEncrypted() bool

func (*Yuubinsya) GetPassword

func (x *Yuubinsya) GetPassword() string

func (*Yuubinsya) ProtoMessage

func (*Yuubinsya) ProtoMessage()

func (*Yuubinsya) ProtoReflect

func (x *Yuubinsya) ProtoReflect() protoreflect.Message

func (*Yuubinsya) Reset

func (x *Yuubinsya) Reset()

func (*Yuubinsya) String

func (x *Yuubinsya) String() string

Jump to

Keyboard shortcuts

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