Documentation ¶
Index ¶
- Variables
- func ApplyGlobalTransportSettings(settings []*TransportConfig) error
- func CreateTransportConfig(name string) (interface{}, error)
- func DialSystem(ctx context.Context, dest net.Destination, sockopt *SocketConfig) (net.Conn, error)
- func DialTaggedOutbound(ctx context.Context, dest net.Destination, tag string) (net.Conn, error)
- func ListenSystem(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.Listener, error)
- func ListenSystemPacket(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.PacketConn, error)
- func RegisterDialerController(ctl func(network, address string, fd uintptr) error) error
- func RegisterListenerController(controller func(network, address string, fd uintptr) error) error
- func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error
- func RegisterTransportDialer(protocol string, dialer dialFunc) error
- func RegisterTransportListener(protocol string, listener ListenFunc) error
- func UseAlternativeSystemDialer(dialer SystemDialer)
- type ConfigCreator
- type ConnHandler
- type Connection
- type ConnectionAuthenticator
- type DefaultListener
- type DefaultSystemDialer
- func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest net.Destination, ...) (net.Conn, error)
- func (d *DefaultSystemDialer) DialIPs(ctx context.Context, src4 net.Address, dests4 []net.Destination, ...) (net.Conn, error)
- func (d *DefaultSystemDialer) DialParallel(ctx context.Context, srcp net.Address, primaries []net.Destination, ...) (net.Conn, error)
- func (d *DefaultSystemDialer) DialSerial(ctx context.Context, src net.Address, dests []net.Destination, ...) (net.Conn, error)
- func (d *DefaultSystemDialer) GetFallbackDelay() time.Duration
- func (d *DefaultSystemDialer) SetFallbackDelay(t time.Duration)
- type Dialer
- type FileLocker
- type ListenFunc
- type Listener
- type MemoryStreamConfig
- type PacketHeader
- type ProxyConfig
- func (*ProxyConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ProxyConfig) GetTag() string
- func (x *ProxyConfig) GetTransportLayerProxy() bool
- func (c *ProxyConfig) HasTag() bool
- func (*ProxyConfig) ProtoMessage()
- func (x *ProxyConfig) ProtoReflect() protoreflect.Message
- func (x *ProxyConfig) Reset()
- func (x *ProxyConfig) String() string
- type SimpleSystemDialer
- func (v *SimpleSystemDialer) Dial(ctx context.Context, src net.Address, dest net.Destination, ...) (net.Conn, error)
- func (v *SimpleSystemDialer) DialIPs(ctx context.Context, src4 net.Address, dests4 []net.Destination, ...) (net.Conn, error)
- func (v *SimpleSystemDialer) GetFallbackDelay() time.Duration
- func (v *SimpleSystemDialer) SetFallbackDelay(t time.Duration)
- type SocketConfig
- func (*SocketConfig) Descriptor() ([]byte, []int)deprecated
- func (x *SocketConfig) GetAcceptProxyProtocol() bool
- func (x *SocketConfig) GetBindAddress() []byte
- func (x *SocketConfig) GetBindInterfaceIndex() uint32
- func (x *SocketConfig) GetBindInterfaceIp4() []byte
- func (x *SocketConfig) GetBindInterfaceIp6() []byte
- func (x *SocketConfig) GetBindInterfaceName() string
- func (x *SocketConfig) GetBindPort() uint32
- func (x *SocketConfig) GetLinuxBindInterfaceUdpUsePktinfo() bool
- func (x *SocketConfig) GetMark() uint32
- func (x *SocketConfig) GetReceiveOriginalDestAddress() bool
- func (x *SocketConfig) GetTcpKeepAliveInterval() int32
- func (x *SocketConfig) GetTfo() SocketConfig_TCPFastOpenState
- func (x *SocketConfig) GetTfoQueueLength() uint32
- func (x *SocketConfig) GetTproxy() SocketConfig_TProxyMode
- func (sockopt *SocketConfig) HasBindAddr() bool
- func (sockopt *SocketConfig) HasBindInterface() bool
- func (*SocketConfig) ProtoMessage()
- func (x *SocketConfig) ProtoReflect() protoreflect.Message
- func (x *SocketConfig) Reset()
- func (x *SocketConfig) String() string
- type SocketConfig_TCPFastOpenState
- func (SocketConfig_TCPFastOpenState) Descriptor() protoreflect.EnumDescriptor
- func (x SocketConfig_TCPFastOpenState) Enum() *SocketConfig_TCPFastOpenState
- func (SocketConfig_TCPFastOpenState) EnumDescriptor() ([]byte, []int)deprecated
- func (x SocketConfig_TCPFastOpenState) Number() protoreflect.EnumNumber
- func (x SocketConfig_TCPFastOpenState) String() string
- func (SocketConfig_TCPFastOpenState) Type() protoreflect.EnumType
- type SocketConfig_TProxyMode
- func (SocketConfig_TProxyMode) Descriptor() protoreflect.EnumDescriptor
- func (x SocketConfig_TProxyMode) Enum() *SocketConfig_TProxyMode
- func (SocketConfig_TProxyMode) EnumDescriptor() ([]byte, []int)deprecated
- func (m SocketConfig_TProxyMode) IsEnabled() bool
- func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber
- func (x SocketConfig_TProxyMode) String() string
- func (SocketConfig_TProxyMode) Type() protoreflect.EnumType
- type StatCouterConnection
- type StreamConfig
- func (*StreamConfig) Descriptor() ([]byte, []int)deprecated
- func (c *StreamConfig) GetEffectiveProtocol() string
- func (c *StreamConfig) GetEffectiveSecuritySettings() (interface{}, error)
- func (c *StreamConfig) GetEffectiveTransportSettings() (interface{}, error)
- func (x *StreamConfig) GetProtocol() TransportProtocoldeprecated
- func (x *StreamConfig) GetProtocolName() string
- func (x *StreamConfig) GetSecuritySettings() []*serial.TypedMessage
- func (x *StreamConfig) GetSecurityType() string
- func (x *StreamConfig) GetSocketSettings() *SocketConfig
- func (x *StreamConfig) GetTransportSettings() []*TransportConfig
- func (c *StreamConfig) GetTransportSettingsFor(protocol string) (interface{}, error)
- func (c *StreamConfig) HasSecuritySettings() bool
- func (*StreamConfig) ProtoMessage()
- func (x *StreamConfig) ProtoReflect() protoreflect.Message
- func (x *StreamConfig) Reset()
- func (x *StreamConfig) String() string
- type SystemDialer
- type SystemDialerAdapter
- type TransportConfig
- func (*TransportConfig) Descriptor() ([]byte, []int)deprecated
- func (x *TransportConfig) GetProtocol() TransportProtocoldeprecated
- func (x *TransportConfig) GetProtocolName() string
- func (x *TransportConfig) GetSettings() *serial.TypedMessage
- func (c *TransportConfig) GetTypedSettings() (interface{}, error)
- func (c *TransportConfig) GetUnifiedProtocolName() string
- func (*TransportConfig) ProtoMessage()
- func (x *TransportConfig) ProtoReflect() protoreflect.Message
- func (x *TransportConfig) Reset()
- func (x *TransportConfig) String() string
- type TransportProtocol
- func (TransportProtocol) Descriptor() protoreflect.EnumDescriptor
- func (x TransportProtocol) Enum() *TransportProtocol
- func (TransportProtocol) EnumDescriptor() ([]byte, []int)deprecated
- func (x TransportProtocol) Number() protoreflect.EnumNumber
- func (x TransportProtocol) String() string
- func (TransportProtocol) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( TransportProtocol_name = map[int32]string{ 0: "TCP", 1: "UDP", 2: "MKCP", 3: "WebSocket", 4: "HTTP", 5: "DomainSocket", } TransportProtocol_value = map[string]int32{ "TCP": 0, "UDP": 1, "MKCP": 2, "WebSocket": 3, "HTTP": 4, "DomainSocket": 5, } )
Enum value maps for TransportProtocol.
var ( SocketConfig_TCPFastOpenState_name = map[int32]string{ 0: "AsIs", 1: "Enable", 2: "Disable", } SocketConfig_TCPFastOpenState_value = map[string]int32{ "AsIs": 0, "Enable": 1, "Disable": 2, } )
Enum value maps for SocketConfig_TCPFastOpenState.
var ( SocketConfig_TProxyMode_name = map[int32]string{ 0: "Off", 1: "TProxy", 2: "Redirect", } SocketConfig_TProxyMode_value = map[string]int32{ "Off": 0, "TProxy": 1, "Redirect": 2, } )
Enum value maps for SocketConfig_TProxyMode.
var (
DialerDNSClient dns.Client //nolint: golint,stylecheck
)
var File_transport_internet_config_proto protoreflect.FileDescriptor
Functions ¶
func ApplyGlobalTransportSettings ¶
func ApplyGlobalTransportSettings(settings []*TransportConfig) error
func CreateTransportConfig ¶
func DialSystem ¶
func DialSystem(ctx context.Context, dest net.Destination, sockopt *SocketConfig) (net.Conn, error)
DialSystem calls system dialer to create a network connection.
func DialTaggedOutbound ¶
func ListenSystem ¶
ListenSystem listens on a local address for incoming TCP connections.
v2ray:api:beta
func ListenSystemPacket ¶
func ListenSystemPacket(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.PacketConn, error)
ListenSystemPacket listens on a local address for incoming UDP connections.
v2ray:api:beta
func RegisterDialerController ¶
RegisterDialerController adds a controller to the effective system dialer. The controller can be used to operate on file descriptors before they are put into use. It only works when effective dialer is the default dialer.
v2ray:api:beta
func RegisterListenerController ¶
RegisterListenerController adds a controller to the effective system listener. The controller can be used to operate on file descriptors before they are put into use.
v2ray:api:beta
func RegisterProtocolConfigCreator ¶
func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error
func RegisterTransportDialer ¶
RegisterTransportDialer registers a Dialer with given name.
func RegisterTransportListener ¶
func RegisterTransportListener(protocol string, listener ListenFunc) error
func UseAlternativeSystemDialer ¶
func UseAlternativeSystemDialer(dialer SystemDialer)
UseAlternativeSystemDialer replaces the current system dialer with a given one. Caller must ensure there is no race condition.
v2ray:api:stable
Types ¶
type ConfigCreator ¶
type ConfigCreator func() interface{}
type ConnHandler ¶
type ConnHandler func(Connection)
type Connection ¶
func Dial ¶
func Dial(ctx context.Context, dest net.Destination, streamSettings *MemoryStreamConfig) (Connection, error)
Dial dials a internet connection towards the given destination.
type ConnectionAuthenticator ¶
func CreateConnectionAuthenticator ¶
func CreateConnectionAuthenticator(config interface{}) (ConnectionAuthenticator, error)
type DefaultListener ¶
type DefaultListener struct {
// contains filtered or unexported fields
}
func (*DefaultListener) Listen ¶
func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.Listener, error)
func (*DefaultListener) ListenPacket ¶
func (dl *DefaultListener) ListenPacket(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.PacketConn, error)
type DefaultSystemDialer ¶
type DefaultSystemDialer struct { // FallbackDelay specifies the length of time to wait before // spawning a RFC 6555 Fast Fallback connection. That is, this // is the amount of time to wait for IPv6 to succeed before // assuming that IPv6 is misconfigured and falling back to // IPv4. // // If zero, a default delay of 300ms is used. // A negative value disables Fast Fallback support. FallbackDelay time.Duration // contains filtered or unexported fields }
func (*DefaultSystemDialer) Dial ¶
func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest net.Destination, sockopt *SocketConfig) (net.Conn, error)
func (*DefaultSystemDialer) DialIPs ¶
func (d *DefaultSystemDialer) DialIPs(ctx context.Context, src4 net.Address, dests4 []net.Destination, src6 net.Address, dests6 []net.Destination, sockopt *SocketConfig) (net.Conn, error)
nolint: gocritic
func (*DefaultSystemDialer) DialParallel ¶
func (d *DefaultSystemDialer) DialParallel(ctx context.Context, srcp net.Address, primaries []net.Destination, srcf net.Address, fallbacks []net.Destination, sockopt *SocketConfig) (net.Conn, error)
DialParallel races two copies of dialSerial, giving the first a head start. It returns the first established connection and closes the others. Otherwise it returns an error from the first primary address.
func (*DefaultSystemDialer) DialSerial ¶
func (d *DefaultSystemDialer) DialSerial(ctx context.Context, src net.Address, dests []net.Destination, sockopt *SocketConfig) (net.Conn, error)
DialSerial connects to a list of addresses in sequence, returning either the first successful connection, or the first error.
func (*DefaultSystemDialer) GetFallbackDelay ¶
func (d *DefaultSystemDialer) GetFallbackDelay() time.Duration
func (*DefaultSystemDialer) SetFallbackDelay ¶
func (d *DefaultSystemDialer) SetFallbackDelay(t time.Duration)
type Dialer ¶
type Dialer interface { // Dial dials a system connection to the given destination. Dial(ctx context.Context, destination net.Destination) (Connection, error) // Addresses returns the local IPv4 and IPv6 addresses used by this Dialer. Maybe nil if not known. Addresses() (addr4, addr6 net.Address) }
Dialer is the interface for dialing outbound connections.
type FileLocker ¶
type FileLocker struct {
// contains filtered or unexported fields
}
FileLocker is UDS access lock
type ListenFunc ¶
type ListenFunc func(ctx context.Context, address net.Address, port net.Port, settings *MemoryStreamConfig, handler ConnHandler) (Listener, error)
type Listener ¶
func ListenTCP ¶
func ListenTCP(ctx context.Context, address net.Address, port net.Port, settings *MemoryStreamConfig, handler ConnHandler) (Listener, error)
func ListenUnix ¶
func ListenUnix(ctx context.Context, address net.Address, settings *MemoryStreamConfig, handler ConnHandler) (Listener, error)
ListenUnix is the UDS version of ListenTCP
type MemoryStreamConfig ¶
type MemoryStreamConfig struct { ProtocolName string ProtocolSettings interface{} SecurityType string SecuritySettings interface{} SocketSettings *SocketConfig }
MemoryStreamConfig is a parsed form of StreamConfig. This is used to reduce number of Protobuf parsing.
func ToMemoryStreamConfig ¶
func ToMemoryStreamConfig(s *StreamConfig) (*MemoryStreamConfig, error)
ToMemoryStreamConfig converts a StreamConfig to MemoryStreamConfig. It returns a default non-nil MemoryStreamConfig for nil input.
type PacketHeader ¶
func CreatePacketHeader ¶
func CreatePacketHeader(config interface{}) (PacketHeader, error)
type ProxyConfig ¶
type ProxyConfig struct { Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` TransportLayerProxy bool `protobuf:"varint,2,opt,name=transportLayerProxy,proto3" json:"transportLayerProxy,omitempty"` // contains filtered or unexported fields }
func (*ProxyConfig) Descriptor
deprecated
func (*ProxyConfig) Descriptor() ([]byte, []int)
Deprecated: Use ProxyConfig.ProtoReflect.Descriptor instead.
func (*ProxyConfig) GetTag ¶
func (x *ProxyConfig) GetTag() string
func (*ProxyConfig) GetTransportLayerProxy ¶
func (x *ProxyConfig) GetTransportLayerProxy() bool
func (*ProxyConfig) HasTag ¶
func (c *ProxyConfig) HasTag() bool
func (*ProxyConfig) ProtoMessage ¶
func (*ProxyConfig) ProtoMessage()
func (*ProxyConfig) ProtoReflect ¶
func (x *ProxyConfig) ProtoReflect() protoreflect.Message
func (*ProxyConfig) Reset ¶
func (x *ProxyConfig) Reset()
func (*ProxyConfig) String ¶
func (x *ProxyConfig) String() string
type SimpleSystemDialer ¶
type SimpleSystemDialer struct {
// contains filtered or unexported fields
}
func (*SimpleSystemDialer) Dial ¶
func (v *SimpleSystemDialer) Dial(ctx context.Context, src net.Address, dest net.Destination, sockopt *SocketConfig) (net.Conn, error)
func (*SimpleSystemDialer) DialIPs ¶
func (v *SimpleSystemDialer) DialIPs(ctx context.Context, src4 net.Address, dests4 []net.Destination, src6 net.Address, dests6 []net.Destination, sockopt *SocketConfig) (net.Conn, error)
nolint: gocritic
func (*SimpleSystemDialer) GetFallbackDelay ¶
func (v *SimpleSystemDialer) GetFallbackDelay() time.Duration
func (*SimpleSystemDialer) SetFallbackDelay ¶
func (v *SimpleSystemDialer) SetFallbackDelay(t time.Duration)
type SocketConfig ¶
type SocketConfig struct { // Mark of the connection. If non-zero, the value will be set to SO_MARK. Mark uint32 `protobuf:"varint,1,opt,name=mark,proto3" json:"mark,omitempty"` // TFO is the state of TFO settings. Tfo SocketConfig_TCPFastOpenState `protobuf:"varint,2,opt,name=tfo,proto3,enum=v2ray.core.transport.internet.SocketConfig_TCPFastOpenState" json:"tfo,omitempty"` TfoQueueLength uint32 `protobuf:"varint,14,opt,name=tfo_queue_length,json=tfoQueueLength,proto3" json:"tfo_queue_length,omitempty"` // TProxy is for enabling TProxy socket option. Tproxy SocketConfig_TProxyMode `protobuf:"varint,3,opt,name=tproxy,proto3,enum=v2ray.core.transport.internet.SocketConfig_TProxyMode" json:"tproxy,omitempty"` // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket // option. This option is for UDP only. ReceiveOriginalDestAddress bool `` /* 144-byte string literal not displayed */ BindInterfaceIndex uint32 `protobuf:"varint,9,opt,name=bind_interface_index,json=bindInterfaceIndex,proto3" json:"bind_interface_index,omitempty"` BindInterfaceName string `protobuf:"bytes,10,opt,name=bind_interface_name,json=bindInterfaceName,proto3" json:"bind_interface_name,omitempty"` BindInterfaceIp4 []byte `protobuf:"bytes,11,opt,name=bind_interface_ip4,json=bindInterfaceIp4,proto3" json:"bind_interface_ip4,omitempty"` BindInterfaceIp6 []byte `protobuf:"bytes,12,opt,name=bind_interface_ip6,json=bindInterfaceIp6,proto3" json:"bind_interface_ip6,omitempty"` LinuxBindInterfaceUdpUsePktinfo bool `` /* 164-byte string literal not displayed */ BindAddress []byte `protobuf:"bytes,5,opt,name=bind_address,json=bindAddress,proto3" json:"bind_address,omitempty"` BindPort uint32 `protobuf:"varint,6,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"` AcceptProxyProtocol bool `protobuf:"varint,7,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"` TcpKeepAliveInterval int32 `` /* 126-byte string literal not displayed */ // contains filtered or unexported fields }
SocketConfig is options to be applied on network sockets.
func (*SocketConfig) Descriptor
deprecated
func (*SocketConfig) Descriptor() ([]byte, []int)
Deprecated: Use SocketConfig.ProtoReflect.Descriptor instead.
func (*SocketConfig) GetAcceptProxyProtocol ¶
func (x *SocketConfig) GetAcceptProxyProtocol() bool
func (*SocketConfig) GetBindAddress ¶
func (x *SocketConfig) GetBindAddress() []byte
func (*SocketConfig) GetBindInterfaceIndex ¶
func (x *SocketConfig) GetBindInterfaceIndex() uint32
func (*SocketConfig) GetBindInterfaceIp4 ¶
func (x *SocketConfig) GetBindInterfaceIp4() []byte
func (*SocketConfig) GetBindInterfaceIp6 ¶
func (x *SocketConfig) GetBindInterfaceIp6() []byte
func (*SocketConfig) GetBindInterfaceName ¶
func (x *SocketConfig) GetBindInterfaceName() string
func (*SocketConfig) GetBindPort ¶
func (x *SocketConfig) GetBindPort() uint32
func (*SocketConfig) GetLinuxBindInterfaceUdpUsePktinfo ¶
func (x *SocketConfig) GetLinuxBindInterfaceUdpUsePktinfo() bool
func (*SocketConfig) GetMark ¶
func (x *SocketConfig) GetMark() uint32
func (*SocketConfig) GetReceiveOriginalDestAddress ¶
func (x *SocketConfig) GetReceiveOriginalDestAddress() bool
func (*SocketConfig) GetTcpKeepAliveInterval ¶
func (x *SocketConfig) GetTcpKeepAliveInterval() int32
func (*SocketConfig) GetTfo ¶
func (x *SocketConfig) GetTfo() SocketConfig_TCPFastOpenState
func (*SocketConfig) GetTfoQueueLength ¶
func (x *SocketConfig) GetTfoQueueLength() uint32
func (*SocketConfig) GetTproxy ¶
func (x *SocketConfig) GetTproxy() SocketConfig_TProxyMode
func (*SocketConfig) HasBindAddr ¶
func (sockopt *SocketConfig) HasBindAddr() bool
func (*SocketConfig) HasBindInterface ¶
func (sockopt *SocketConfig) HasBindInterface() bool
func (*SocketConfig) ProtoMessage ¶
func (*SocketConfig) ProtoMessage()
func (*SocketConfig) ProtoReflect ¶
func (x *SocketConfig) ProtoReflect() protoreflect.Message
func (*SocketConfig) Reset ¶
func (x *SocketConfig) Reset()
func (*SocketConfig) String ¶
func (x *SocketConfig) String() string
type SocketConfig_TCPFastOpenState ¶
type SocketConfig_TCPFastOpenState int32
const ( // AsIs is to leave the current TFO state as is, unmodified. SocketConfig_AsIs SocketConfig_TCPFastOpenState = 0 // Enable is for enabling TFO explictly. SocketConfig_Enable SocketConfig_TCPFastOpenState = 1 // Disable is for disabling TFO explictly. SocketConfig_Disable SocketConfig_TCPFastOpenState = 2 )
func (SocketConfig_TCPFastOpenState) Descriptor ¶
func (SocketConfig_TCPFastOpenState) Descriptor() protoreflect.EnumDescriptor
func (SocketConfig_TCPFastOpenState) Enum ¶
func (x SocketConfig_TCPFastOpenState) Enum() *SocketConfig_TCPFastOpenState
func (SocketConfig_TCPFastOpenState) EnumDescriptor
deprecated
func (SocketConfig_TCPFastOpenState) EnumDescriptor() ([]byte, []int)
Deprecated: Use SocketConfig_TCPFastOpenState.Descriptor instead.
func (SocketConfig_TCPFastOpenState) Number ¶
func (x SocketConfig_TCPFastOpenState) Number() protoreflect.EnumNumber
func (SocketConfig_TCPFastOpenState) String ¶
func (x SocketConfig_TCPFastOpenState) String() string
func (SocketConfig_TCPFastOpenState) Type ¶
func (SocketConfig_TCPFastOpenState) Type() protoreflect.EnumType
type SocketConfig_TProxyMode ¶
type SocketConfig_TProxyMode int32
const ( // TProxy is off. SocketConfig_Off SocketConfig_TProxyMode = 0 // TProxy mode. SocketConfig_TProxy SocketConfig_TProxyMode = 1 // Redirect mode. SocketConfig_Redirect SocketConfig_TProxyMode = 2 )
func (SocketConfig_TProxyMode) Descriptor ¶
func (SocketConfig_TProxyMode) Descriptor() protoreflect.EnumDescriptor
func (SocketConfig_TProxyMode) Enum ¶
func (x SocketConfig_TProxyMode) Enum() *SocketConfig_TProxyMode
func (SocketConfig_TProxyMode) EnumDescriptor
deprecated
func (SocketConfig_TProxyMode) EnumDescriptor() ([]byte, []int)
Deprecated: Use SocketConfig_TProxyMode.Descriptor instead.
func (SocketConfig_TProxyMode) IsEnabled ¶
func (m SocketConfig_TProxyMode) IsEnabled() bool
func (SocketConfig_TProxyMode) Number ¶
func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber
func (SocketConfig_TProxyMode) String ¶
func (x SocketConfig_TProxyMode) String() string
func (SocketConfig_TProxyMode) Type ¶
func (SocketConfig_TProxyMode) Type() protoreflect.EnumType
type StatCouterConnection ¶
type StatCouterConnection struct { Connection ReadCounter stats.Counter WriteCounter stats.Counter }
type StreamConfig ¶
type StreamConfig struct { // Effective network. Deprecated. Use the string form below. // // Deprecated: Do not use. Protocol TransportProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=v2ray.core.transport.internet.TransportProtocol" json:"protocol,omitempty"` // Effective network. ProtocolName string `protobuf:"bytes,5,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"` TransportSettings []*TransportConfig `protobuf:"bytes,2,rep,name=transport_settings,json=transportSettings,proto3" json:"transport_settings,omitempty"` // Type of security. Must be a message name of the settings proto. SecurityType string `protobuf:"bytes,3,opt,name=security_type,json=securityType,proto3" json:"security_type,omitempty"` // Settings for transport security. For now the only choice is TLS. SecuritySettings []*serial.TypedMessage `protobuf:"bytes,4,rep,name=security_settings,json=securitySettings,proto3" json:"security_settings,omitempty"` SocketSettings *SocketConfig `protobuf:"bytes,6,opt,name=socket_settings,json=socketSettings,proto3" json:"socket_settings,omitempty"` // contains filtered or unexported fields }
func (*StreamConfig) Descriptor
deprecated
func (*StreamConfig) Descriptor() ([]byte, []int)
Deprecated: Use StreamConfig.ProtoReflect.Descriptor instead.
func (*StreamConfig) GetEffectiveProtocol ¶
func (c *StreamConfig) GetEffectiveProtocol() string
func (*StreamConfig) GetEffectiveSecuritySettings ¶
func (c *StreamConfig) GetEffectiveSecuritySettings() (interface{}, error)
func (*StreamConfig) GetEffectiveTransportSettings ¶
func (c *StreamConfig) GetEffectiveTransportSettings() (interface{}, error)
func (*StreamConfig) GetProtocol
deprecated
func (x *StreamConfig) GetProtocol() TransportProtocol
Deprecated: Do not use.
func (*StreamConfig) GetProtocolName ¶
func (x *StreamConfig) GetProtocolName() string
func (*StreamConfig) GetSecuritySettings ¶
func (x *StreamConfig) GetSecuritySettings() []*serial.TypedMessage
func (*StreamConfig) GetSecurityType ¶
func (x *StreamConfig) GetSecurityType() string
func (*StreamConfig) GetSocketSettings ¶
func (x *StreamConfig) GetSocketSettings() *SocketConfig
func (*StreamConfig) GetTransportSettings ¶
func (x *StreamConfig) GetTransportSettings() []*TransportConfig
func (*StreamConfig) GetTransportSettingsFor ¶
func (c *StreamConfig) GetTransportSettingsFor(protocol string) (interface{}, error)
func (*StreamConfig) HasSecuritySettings ¶
func (c *StreamConfig) HasSecuritySettings() bool
func (*StreamConfig) ProtoMessage ¶
func (*StreamConfig) ProtoMessage()
func (*StreamConfig) ProtoReflect ¶
func (x *StreamConfig) ProtoReflect() protoreflect.Message
func (*StreamConfig) Reset ¶
func (x *StreamConfig) Reset()
func (*StreamConfig) String ¶
func (x *StreamConfig) String() string
type SystemDialer ¶
type SystemDialer interface { Dial(ctx context.Context, source net.Address, destination net.Destination, sockopt *SocketConfig) (net.Conn, error) DialIPs(ctx context.Context, src4 net.Address, dests4 []net.Destination, src6 net.Address, dests6 []net.Destination, sockopt *SocketConfig) (net.Conn, error) GetFallbackDelay() time.Duration SetFallbackDelay(time.Duration) }
func WithAdapter ¶
func WithAdapter(dialer SystemDialerAdapter) SystemDialer
type SystemDialerAdapter ¶
type TransportConfig ¶
type TransportConfig struct { // Type of network that this settings supports. // Deprecated. Use the string form below. // // Deprecated: Do not use. Protocol TransportProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=v2ray.core.transport.internet.TransportProtocol" json:"protocol,omitempty"` // Type of network that this settings supports. ProtocolName string `protobuf:"bytes,3,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"` // Specific settings. Must be of the transports. Settings *serial.TypedMessage `protobuf:"bytes,2,opt,name=settings,proto3" json:"settings,omitempty"` // contains filtered or unexported fields }
func (*TransportConfig) Descriptor
deprecated
func (*TransportConfig) Descriptor() ([]byte, []int)
Deprecated: Use TransportConfig.ProtoReflect.Descriptor instead.
func (*TransportConfig) GetProtocol
deprecated
func (x *TransportConfig) GetProtocol() TransportProtocol
Deprecated: Do not use.
func (*TransportConfig) GetProtocolName ¶
func (x *TransportConfig) GetProtocolName() string
func (*TransportConfig) GetSettings ¶
func (x *TransportConfig) GetSettings() *serial.TypedMessage
func (*TransportConfig) GetTypedSettings ¶
func (c *TransportConfig) GetTypedSettings() (interface{}, error)
func (*TransportConfig) GetUnifiedProtocolName ¶
func (c *TransportConfig) GetUnifiedProtocolName() string
func (*TransportConfig) ProtoMessage ¶
func (*TransportConfig) ProtoMessage()
func (*TransportConfig) ProtoReflect ¶
func (x *TransportConfig) ProtoReflect() protoreflect.Message
func (*TransportConfig) Reset ¶
func (x *TransportConfig) Reset()
func (*TransportConfig) String ¶
func (x *TransportConfig) String() string
type TransportProtocol ¶
type TransportProtocol int32
const ( TransportProtocol_TCP TransportProtocol = 0 TransportProtocol_UDP TransportProtocol = 1 TransportProtocol_MKCP TransportProtocol = 2 TransportProtocol_WebSocket TransportProtocol = 3 TransportProtocol_HTTP TransportProtocol = 4 TransportProtocol_DomainSocket TransportProtocol = 5 )
func (TransportProtocol) Descriptor ¶
func (TransportProtocol) Descriptor() protoreflect.EnumDescriptor
func (TransportProtocol) Enum ¶
func (x TransportProtocol) Enum() *TransportProtocol
func (TransportProtocol) EnumDescriptor
deprecated
func (TransportProtocol) EnumDescriptor() ([]byte, []int)
Deprecated: Use TransportProtocol.Descriptor instead.
func (TransportProtocol) Number ¶
func (x TransportProtocol) Number() protoreflect.EnumNumber
func (TransportProtocol) String ¶
func (x TransportProtocol) String() string
func (TransportProtocol) Type ¶
func (TransportProtocol) Type() protoreflect.EnumType
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
headers
|
|
Package kcp - A Fast and Reliable ARQ Protocol
|
Package kcp - A Fast and Reliable ARQ Protocol |
Package websocket implements Websocket transport
|
Package websocket implements Websocket transport |