Documentation
¶
Index ¶
- Variables
- func CreateServer(opts *Opts[IsProtocol_Protocol]) (proxy.Server, error)
- func ParseTLS(t *TlsConfig) (*tls.Config, error)
- func RegisterProtocol[T isProtocol_Protocol](wrap func(*Opts[T]) (proxy.Server, error))
- type Certificate
- func (*Certificate) Descriptor() ([]byte, []int)deprecated
- func (x *Certificate) GetCert() []byte
- func (x *Certificate) GetCertFilePath() string
- func (x *Certificate) GetKey() []byte
- func (x *Certificate) GetKeyFilePath() string
- func (*Certificate) ProtoMessage()
- func (x *Certificate) ProtoReflect() protoreflect.Message
- func (x *Certificate) Reset()
- func (x *Certificate) String() string
- func (c *Certificate) X509KeyPair() (tls.Certificate, error)
- type Config
- type Grpc
- type Http
- type Http2
- type IsProtocol_Protocol
- type Normal
- type Opts
- type ProcessDumper
- type Protocol
- func (*Protocol) Descriptor() ([]byte, []int)deprecated
- func (x *Protocol) GetEnabled() bool
- func (x *Protocol) GetHttp() *Http
- func (x *Protocol) GetName() string
- func (m *Protocol) GetProtocol() isProtocol_Protocol
- func (x *Protocol) GetRedir() *Redir
- func (x *Protocol) GetSocks5() *Socks5
- func (x *Protocol) GetTun() *Tun
- func (x *Protocol) GetYuubinsya() *Yuubinsya
- func (*Protocol) ProtoMessage()
- func (x *Protocol) ProtoReflect() protoreflect.Message
- func (x *Protocol) Reset()
- func (x *Protocol) String() string
- type Protocol_Http
- type Protocol_Redir
- type Protocol_Socks5
- type Protocol_Tun
- type Protocol_Yuubinsya
- type Quic
- type Reality
- func (*Reality) Descriptor() ([]byte, []int)deprecated
- func (x *Reality) GetDebug() bool
- func (x *Reality) GetDest() string
- func (x *Reality) GetPrivateKey() string
- func (x *Reality) GetServerName() []string
- func (x *Reality) GetShortId() []string
- func (*Reality) ProtoMessage()
- func (x *Reality) ProtoReflect() protoreflect.Message
- func (x *Reality) Reset()
- func (x *Reality) String() string
- type Redir
- type Socks5
- func (*Socks5) Descriptor() ([]byte, []int)deprecated
- func (x *Socks5) GetHost() string
- func (x *Socks5) GetPassword() string
- func (x *Socks5) GetUsername() string
- func (*Socks5) ProtoMessage()
- func (x *Socks5) ProtoReflect() protoreflect.Message
- func (x *Socks5) Reset()
- func (x *Socks5) String() string
- type Tls
- type TlsConfig
- func (*TlsConfig) Descriptor() ([]byte, []int)deprecated
- func (x *TlsConfig) GetCertificates() []*Certificate
- func (x *TlsConfig) GetNextProtos() []string
- func (x *TlsConfig) GetServerNameCertificate() map[string]*Certificate
- func (t *TlsConfig) ParseCertificates() []tls.Certificate
- func (t *TlsConfig) ParseServerNameCertificate() *mapper.Combine[*tls.Certificate]
- func (*TlsConfig) ProtoMessage()
- func (x *TlsConfig) ProtoReflect() protoreflect.Message
- func (x *TlsConfig) Reset()
- func (x *TlsConfig) String() string
- type TlsConfigManager
- type Tun
- func (*Tun) Descriptor() ([]byte, []int)deprecated
- func (x *Tun) GetDnsHijacking() bool
- func (x *Tun) GetDriver() TunEndpointDriver
- func (x *Tun) GetGateway() string
- func (x *Tun) GetMtu() int32
- func (x *Tun) GetName() string
- func (x *Tun) GetPortal() string
- func (x *Tun) GetSkipMulticast() bool
- func (*Tun) ProtoMessage()
- func (x *Tun) ProtoReflect() protoreflect.Message
- func (x *Tun) Reset()
- func (x *Tun) String() string
- type TunEndpointDriver
- func (TunEndpointDriver) Descriptor() protoreflect.EnumDescriptor
- func (x TunEndpointDriver) Enum() *TunEndpointDriver
- func (TunEndpointDriver) EnumDescriptor() ([]byte, []int)deprecated
- func (x TunEndpointDriver) Number() protoreflect.EnumNumber
- func (x TunEndpointDriver) String() string
- func (TunEndpointDriver) Type() protoreflect.EnumType
- type Websocket
- type Yuubinsya
- func (*Yuubinsya) Descriptor() ([]byte, []int)deprecated
- func (x *Yuubinsya) GetForceDisableEncrypt() bool
- func (x *Yuubinsya) GetGrpc() *Grpc
- func (x *Yuubinsya) GetHost() string
- func (x *Yuubinsya) GetHttp2() *Http2
- func (x *Yuubinsya) GetNormal() *Normal
- func (x *Yuubinsya) GetPassword() string
- func (m *Yuubinsya) GetProtocol() isYuubinsya_Protocol
- func (x *Yuubinsya) GetQuic() *Quic
- func (x *Yuubinsya) GetReality() *Reality
- func (x *Yuubinsya) GetTls() *Tls
- func (x *Yuubinsya) GetWebsocket() *Websocket
- func (*Yuubinsya) ProtoMessage()
- func (x *Yuubinsya) ProtoReflect() protoreflect.Message
- func (x *Yuubinsya) Reset()
- func (x *Yuubinsya) String() string
- type YuubinsyaProtocolNormal
- type Yuubinsya_Grpc
- type Yuubinsya_Http2
- type Yuubinsya_Normal
- type Yuubinsya_Quic
- type Yuubinsya_Reality
- type Yuubinsya_Tls
- type Yuubinsya_Websocket
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TunEndpointDriver_name = map[int32]string{ 0: "fdbased", 1: "channel", 2: "system_gvisor", } TunEndpointDriver_value = map[string]int32{ "fdbased": 0, "channel": 1, "system_gvisor": 2, } )
Enum value maps for TunEndpointDriver.
View Source
var File_config_listener_listener_proto protoreflect.FileDescriptor
Functions ¶
func CreateServer ¶
func CreateServer(opts *Opts[IsProtocol_Protocol]) (proxy.Server, error)
Types ¶
type Certificate ¶
type Certificate struct { Cert []byte `protobuf:"bytes,1,opt,name=cert,proto3" json:"cert,omitempty"` Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` CertFilePath string `protobuf:"bytes,3,opt,name=cert_file_path,proto3" json:"cert_file_path,omitempty"` KeyFilePath string `protobuf:"bytes,4,opt,name=key_file_path,proto3" json:"key_file_path,omitempty"` // contains filtered or unexported fields }
func (*Certificate) Descriptor
deprecated
func (*Certificate) Descriptor() ([]byte, []int)
Deprecated: Use Certificate.ProtoReflect.Descriptor instead.
func (*Certificate) GetCert ¶
func (x *Certificate) GetCert() []byte
func (*Certificate) GetCertFilePath ¶
func (x *Certificate) GetCertFilePath() string
func (*Certificate) GetKey ¶
func (x *Certificate) GetKey() []byte
func (*Certificate) GetKeyFilePath ¶
func (x *Certificate) GetKeyFilePath() string
func (*Certificate) ProtoMessage ¶
func (*Certificate) ProtoMessage()
func (*Certificate) ProtoReflect ¶
func (x *Certificate) ProtoReflect() protoreflect.Message
func (*Certificate) Reset ¶
func (x *Certificate) Reset()
func (*Certificate) String ¶
func (x *Certificate) String() string
func (*Certificate) X509KeyPair ¶
func (c *Certificate) X509KeyPair() (tls.Certificate, error)
type Config ¶
type Config struct { Servers map[string]*Protocol `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetServers ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*Grpc) ProtoMessage()
func (*Grpc) ProtoReflect ¶
func (x *Grpc) ProtoReflect() protoreflect.Message
type Http ¶
type Http struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*Http) Descriptor
deprecated
func (*Http) GetPassword ¶
func (*Http) GetUsername ¶
func (*Http) ProtoMessage ¶
func (*Http) ProtoMessage()
func (*Http) ProtoReflect ¶
func (x *Http) ProtoReflect() protoreflect.Message
type Http2 ¶
type Http2 struct { Tls *TlsConfig `protobuf:"bytes,1,opt,name=tls,proto3" json:"tls,omitempty"` // contains filtered or unexported fields }
func (*Http2) Descriptor
deprecated
func (*Http2) ProtoMessage ¶
func (*Http2) ProtoMessage()
func (*Http2) ProtoReflect ¶
func (x *Http2) ProtoReflect() protoreflect.Message
type IsProtocol_Protocol ¶
type IsProtocol_Protocol interface {
// contains filtered or unexported methods
}
type Normal ¶
type Normal struct {
// contains filtered or unexported fields
}
func (*Normal) Descriptor
deprecated
func (*Normal) ProtoMessage ¶
func (*Normal) ProtoMessage()
func (*Normal) ProtoReflect ¶
func (x *Normal) ProtoReflect() protoreflect.Message
type Opts ¶
type Opts[T isProtocol_Protocol] struct { IPv6 bool Protocol T DNSHandler proxy.DNSHandler Handler proxy.Handler }
func CovertOpts ¶
type ProcessDumper ¶
type Protocol ¶
type Protocol struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` // Types that are assignable to Protocol: // // *Protocol_Http // *Protocol_Socks5 // *Protocol_Redir // *Protocol_Tun // *Protocol_Yuubinsya Protocol isProtocol_Protocol `protobuf_oneof:"protocol"` // contains filtered or unexported fields }
func (*Protocol) Descriptor
deprecated
func (*Protocol) GetEnabled ¶
func (*Protocol) GetProtocol ¶
func (m *Protocol) GetProtocol() isProtocol_Protocol
func (*Protocol) GetYuubinsya ¶
func (*Protocol) ProtoMessage ¶
func (*Protocol) ProtoMessage()
func (*Protocol) ProtoReflect ¶
func (x *Protocol) ProtoReflect() protoreflect.Message
type Protocol_Http ¶
type Protocol_Http struct {
Http *Http `protobuf:"bytes,3,opt,name=http,proto3,oneof"`
}
type Protocol_Redir ¶
type Protocol_Redir struct {
Redir *Redir `protobuf:"bytes,5,opt,name=redir,proto3,oneof"`
}
type Protocol_Socks5 ¶
type Protocol_Socks5 struct {
Socks5 *Socks5 `protobuf:"bytes,4,opt,name=socks5,proto3,oneof"`
}
type Protocol_Tun ¶
type Protocol_Tun struct {
Tun *Tun `protobuf:"bytes,6,opt,name=tun,proto3,oneof"`
}
type Protocol_Yuubinsya ¶
type Protocol_Yuubinsya struct {
Yuubinsya *Yuubinsya `protobuf:"bytes,7,opt,name=yuubinsya,proto3,oneof"`
}
type Quic ¶
type Quic struct { Tls *TlsConfig `protobuf:"bytes,1,opt,name=tls,proto3" json:"tls,omitempty"` // contains filtered or unexported fields }
func (*Quic) Descriptor
deprecated
func (*Quic) ProtoMessage ¶
func (*Quic) ProtoMessage()
func (*Quic) ProtoReflect ¶
func (x *Quic) ProtoReflect() protoreflect.Message
type Reality ¶
type Reality struct { ShortId []string `protobuf:"bytes,1,rep,name=short_id,proto3" json:"short_id,omitempty"` ServerName []string `protobuf:"bytes,2,rep,name=server_name,proto3" json:"server_name,omitempty"` Dest string `protobuf:"bytes,3,opt,name=dest,proto3" json:"dest,omitempty"` PrivateKey string `protobuf:"bytes,4,opt,name=private_key,proto3" json:"private_key,omitempty"` Debug bool `protobuf:"varint,5,opt,name=debug,proto3" json:"debug,omitempty"` // contains filtered or unexported fields }
func (*Reality) Descriptor
deprecated
func (*Reality) GetPrivateKey ¶
func (*Reality) GetServerName ¶
func (*Reality) GetShortId ¶
func (*Reality) ProtoMessage ¶
func (*Reality) ProtoMessage()
func (*Reality) ProtoReflect ¶
func (x *Reality) ProtoReflect() protoreflect.Message
type Redir ¶
type Redir struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // contains filtered or unexported fields }
func (*Redir) Descriptor
deprecated
func (*Redir) ProtoMessage ¶
func (*Redir) ProtoMessage()
func (*Redir) ProtoReflect ¶
func (x *Redir) ProtoReflect() protoreflect.Message
type Socks5 ¶
type Socks5 struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*Socks5) Descriptor
deprecated
func (*Socks5) GetPassword ¶
func (*Socks5) GetUsername ¶
func (*Socks5) ProtoMessage ¶
func (*Socks5) ProtoMessage()
func (*Socks5) ProtoReflect ¶
func (x *Socks5) ProtoReflect() protoreflect.Message
type Tls ¶
type Tls struct { Tls *TlsConfig `protobuf:"bytes,1,opt,name=tls,proto3" json:"tls,omitempty"` // contains filtered or unexported fields }
func (*Tls) Descriptor
deprecated
func (*Tls) ProtoMessage ¶
func (*Tls) ProtoMessage()
func (*Tls) ProtoReflect ¶
func (x *Tls) ProtoReflect() protoreflect.Message
type TlsConfig ¶
type TlsConfig struct { Certificates []*Certificate `protobuf:"bytes,1,rep,name=certificates,proto3" json:"certificates,omitempty"` NextProtos []string `protobuf:"bytes,3,rep,name=next_protos,proto3" json:"next_protos,omitempty"` ServerNameCertificate map[string]*Certificate `` /* 187-byte string literal not displayed */ // contains filtered or unexported fields }
func (*TlsConfig) Descriptor
deprecated
func (*TlsConfig) GetCertificates ¶
func (x *TlsConfig) GetCertificates() []*Certificate
func (*TlsConfig) GetNextProtos ¶
func (*TlsConfig) GetServerNameCertificate ¶
func (x *TlsConfig) GetServerNameCertificate() map[string]*Certificate
func (*TlsConfig) ParseCertificates ¶
func (t *TlsConfig) ParseCertificates() []tls.Certificate
func (*TlsConfig) ParseServerNameCertificate ¶
func (t *TlsConfig) ParseServerNameCertificate() *mapper.Combine[*tls.Certificate]
func (*TlsConfig) ProtoMessage ¶
func (*TlsConfig) ProtoMessage()
func (*TlsConfig) ProtoReflect ¶
func (x *TlsConfig) ProtoReflect() protoreflect.Message
type TlsConfigManager ¶
type TlsConfigManager struct {
// contains filtered or unexported fields
}
func NewTlsConfigManager ¶
func NewTlsConfigManager(t *TlsConfig) *TlsConfigManager
func (*TlsConfigManager) Refresh ¶
func (t *TlsConfigManager) Refresh()
type Tun ¶
type Tun struct { // name of the tun device // eg: tun://tun0, fd://123 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Mtu int32 `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"` Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` DnsHijacking bool `protobuf:"varint,4,opt,name=dns_hijacking,proto3" json:"dns_hijacking,omitempty"` SkipMulticast bool `protobuf:"varint,6,opt,name=skip_multicast,proto3" json:"skip_multicast,omitempty"` Driver TunEndpointDriver `protobuf:"varint,7,opt,name=driver,proto3,enum=yuhaiin.listener.TunEndpointDriver" json:"driver,omitempty"` Portal string `protobuf:"bytes,8,opt,name=portal,proto3" json:"portal,omitempty"` // contains filtered or unexported fields }
func (*Tun) Descriptor
deprecated
func (*Tun) GetDnsHijacking ¶
func (*Tun) GetDriver ¶
func (x *Tun) GetDriver() TunEndpointDriver
func (*Tun) GetGateway ¶
func (*Tun) GetSkipMulticast ¶
func (*Tun) ProtoMessage ¶
func (*Tun) ProtoMessage()
func (*Tun) ProtoReflect ¶
func (x *Tun) ProtoReflect() protoreflect.Message
type TunEndpointDriver ¶
type TunEndpointDriver int32
const ( Tun_fdbased TunEndpointDriver = 0 Tun_channel TunEndpointDriver = 1 Tun_system_gvisor TunEndpointDriver = 2 )
func (TunEndpointDriver) Descriptor ¶
func (TunEndpointDriver) Descriptor() protoreflect.EnumDescriptor
func (TunEndpointDriver) Enum ¶
func (x TunEndpointDriver) Enum() *TunEndpointDriver
func (TunEndpointDriver) EnumDescriptor
deprecated
func (TunEndpointDriver) EnumDescriptor() ([]byte, []int)
Deprecated: Use TunEndpointDriver.Descriptor instead.
func (TunEndpointDriver) Number ¶
func (x TunEndpointDriver) Number() protoreflect.EnumNumber
func (TunEndpointDriver) String ¶
func (x TunEndpointDriver) String() string
func (TunEndpointDriver) Type ¶
func (TunEndpointDriver) Type() protoreflect.EnumType
type Websocket ¶
type Websocket struct { Tls *TlsConfig `protobuf:"bytes,1,opt,name=tls,proto3" json:"tls,omitempty"` // contains filtered or unexported fields }
func (*Websocket) Descriptor
deprecated
func (*Websocket) ProtoMessage ¶
func (*Websocket) ProtoMessage()
func (*Websocket) ProtoReflect ¶
func (x *Websocket) ProtoReflect() protoreflect.Message
type Yuubinsya ¶
type Yuubinsya struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` ForceDisableEncrypt bool `protobuf:"varint,8,opt,name=force_disable_encrypt,proto3" json:"force_disable_encrypt,omitempty"` // Types that are assignable to Protocol: // // *Yuubinsya_Normal // *Yuubinsya_Tls // *Yuubinsya_Quic // *Yuubinsya_Websocket // *Yuubinsya_Grpc // *Yuubinsya_Http2 // *Yuubinsya_Reality Protocol isYuubinsya_Protocol `protobuf_oneof:"protocol"` // contains filtered or unexported fields }
func (*Yuubinsya) Descriptor
deprecated
func (*Yuubinsya) GetForceDisableEncrypt ¶
func (*Yuubinsya) GetPassword ¶
func (*Yuubinsya) GetProtocol ¶
func (m *Yuubinsya) GetProtocol() isYuubinsya_Protocol
func (*Yuubinsya) GetReality ¶
func (*Yuubinsya) GetWebsocket ¶
func (*Yuubinsya) ProtoMessage ¶
func (*Yuubinsya) ProtoMessage()
func (*Yuubinsya) ProtoReflect ¶
func (x *Yuubinsya) ProtoReflect() protoreflect.Message
type YuubinsyaProtocolNormal ¶
type YuubinsyaProtocolNormal struct {
// contains filtered or unexported fields
}
func (*YuubinsyaProtocolNormal) Descriptor
deprecated
func (*YuubinsyaProtocolNormal) Descriptor() ([]byte, []int)
Deprecated: Use YuubinsyaProtocolNormal.ProtoReflect.Descriptor instead.
func (*YuubinsyaProtocolNormal) ProtoMessage ¶
func (*YuubinsyaProtocolNormal) ProtoMessage()
func (*YuubinsyaProtocolNormal) ProtoReflect ¶
func (x *YuubinsyaProtocolNormal) ProtoReflect() protoreflect.Message
func (*YuubinsyaProtocolNormal) Reset ¶
func (x *YuubinsyaProtocolNormal) Reset()
func (*YuubinsyaProtocolNormal) String ¶
func (x *YuubinsyaProtocolNormal) String() string
type Yuubinsya_Grpc ¶
type Yuubinsya_Grpc struct {
Grpc *Grpc `protobuf:"bytes,7,opt,name=grpc,proto3,oneof"`
}
type Yuubinsya_Http2 ¶
type Yuubinsya_Http2 struct {
Http2 *Http2 `protobuf:"bytes,9,opt,name=http2,proto3,oneof"`
}
type Yuubinsya_Normal ¶
type Yuubinsya_Normal struct {
Normal *Normal `protobuf:"bytes,3,opt,name=normal,proto3,oneof"`
}
type Yuubinsya_Quic ¶
type Yuubinsya_Quic struct {
Quic *Quic `protobuf:"bytes,5,opt,name=quic,proto3,oneof"`
}
type Yuubinsya_Reality ¶
type Yuubinsya_Reality struct {
Reality *Reality `protobuf:"bytes,10,opt,name=reality,proto3,oneof"`
}
type Yuubinsya_Tls ¶
type Yuubinsya_Tls struct {
Tls *Tls `protobuf:"bytes,4,opt,name=tls,proto3,oneof"`
}
type Yuubinsya_Websocket ¶
type Yuubinsya_Websocket struct {
Websocket *Websocket `protobuf:"bytes,6,opt,name=websocket,proto3,oneof"`
}
Click to show internal directories.
Click to hide internal directories.