From a4dfca0ef7fdc26eb0ddc072c584e3a80adb818c Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 23 Dec 2016 12:42:25 +0100 Subject: [PATCH] accommodate protobuf compiler change --- app/router/config.pb.go | 56 +++++++++++++++++ app/web/config.pb.go | 14 +++++ common/log/config.pb.go | 35 +++++++++++ common/net/destination.pb.go | 14 +++++ common/net/network.pb.go | 7 +++ common/net/port.pb.go | 14 +++++ common/protocol/headers.pb.go | 7 +++ common/protocol/server_spec.pb.go | 7 +++ common/protocol/user.pb.go | 14 +++++ common/serial/typed_message.pb.go | 14 +++++ config.go | 12 ++-- config.pb.go | 42 +++++++++++++ inbound_detour_always.go | 2 +- inbound_detour_dynamic.go | 8 +-- proxy/dokodemo/config.pb.go | 21 +++++++ proxy/freedom/config.pb.go | 14 +++++ proxy/http/config.pb.go | 7 +++ proxy/shadowsocks/config.pb.go | 28 +++++++++ proxy/socks/config.pb.go | 35 +++++++++++ proxy/vmess/account.pb.go | 14 +++++ proxy/vmess/inbound/config.pb.go | 21 +++++++ transport/internet/config.pb.go | 28 +++++++++ transport/internet/headers/http/config.go | 66 +++++++++++--------- transport/internet/headers/http/config.pb.go | 49 +++++++++++++++ transport/internet/headers/http/http.go | 4 +- transport/internet/headers/srtp/config.pb.go | 42 +++++++++++++ transport/internet/headers/utp/config.pb.go | 7 +++ transport/internet/kcp/config.go | 62 +++++++++--------- transport/internet/kcp/config.pb.go | 56 +++++++++++++++++ transport/internet/kcp/connection.go | 10 +-- transport/internet/tcp/config.pb.go | 7 +++ transport/internet/tls/config.pb.go | 28 +++++++++ transport/internet/websocket/config.pb.go | 14 +++++ 33 files changed, 679 insertions(+), 80 deletions(-) diff --git a/app/router/config.pb.go b/app/router/config.pb.go index 58b2af5be..364cb9e35 100644 --- a/app/router/config.pb.go +++ b/app/router/config.pb.go @@ -97,6 +97,20 @@ func (m *Domain) String() string { return proto.CompactTextString(m) func (*Domain) ProtoMessage() {} func (*Domain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Domain) GetType() Domain_Type { + if m != nil { + return m.Type + } + return Domain_Plain +} + +func (m *Domain) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + // IP for routing decision, in CIDR form. type CIDR struct { // IP address, should be either 4 or 16 bytes. @@ -110,6 +124,20 @@ func (m *CIDR) String() string { return proto.CompactTextString(m) } func (*CIDR) ProtoMessage() {} func (*CIDR) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *CIDR) GetIp() []byte { + if m != nil { + return m.Ip + } + return nil +} + +func (m *CIDR) GetPrefix() uint32 { + if m != nil { + return m.Prefix + } + return 0 +} + type RoutingRule struct { Tag string `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"` Domain []*Domain `protobuf:"bytes,2,rep,name=domain" json:"domain,omitempty"` @@ -126,6 +154,13 @@ func (m *RoutingRule) String() string { return proto.CompactTextStrin func (*RoutingRule) ProtoMessage() {} func (*RoutingRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *RoutingRule) GetTag() string { + if m != nil { + return m.Tag + } + return "" +} + func (m *RoutingRule) GetDomain() []*Domain { if m != nil { return m.Domain @@ -161,6 +196,20 @@ func (m *RoutingRule) GetSourceCidr() []*CIDR { return nil } +func (m *RoutingRule) GetUserEmail() []string { + if m != nil { + return m.UserEmail + } + return nil +} + +func (m *RoutingRule) GetInboundTag() []string { + if m != nil { + return m.InboundTag + } + return nil +} + type Config struct { DomainStrategy Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,enum=v2ray.core.app.router.Config_DomainStrategy" json:"domain_strategy,omitempty"` Rule []*RoutingRule `protobuf:"bytes,2,rep,name=rule" json:"rule,omitempty"` @@ -171,6 +220,13 @@ func (m *Config) String() string { return proto.CompactTextString(m) func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (m *Config) GetDomainStrategy() Config_DomainStrategy { + if m != nil { + return m.DomainStrategy + } + return Config_AsIs +} + func (m *Config) GetRule() []*RoutingRule { if m != nil { return m.Rule diff --git a/app/web/config.pb.go b/app/web/config.pb.go index 9f4dd527f..e2f77a2a7 100644 --- a/app/web/config.pb.go +++ b/app/web/config.pb.go @@ -95,6 +95,13 @@ func (m *FileServer_Entry) GetDirectory() string { return "" } +func (m *FileServer_Entry) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*FileServer_Entry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _FileServer_Entry_OneofMarshaler, _FileServer_Entry_OneofUnmarshaler, _FileServer_Entry_OneofSizer, []interface{}{ @@ -171,6 +178,13 @@ func (m *Server) String() string { return proto.CompactTextString(m) func (*Server) ProtoMessage() {} func (*Server) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *Server) GetDomain() []string { + if m != nil { + return m.Domain + } + return nil +} + func (m *Server) GetSettings() *v2ray_core_common_serial.TypedMessage { if m != nil { return m.Settings diff --git a/common/log/config.pb.go b/common/log/config.pb.go index 2d37b7272..7701a9ad2 100644 --- a/common/log/config.pb.go +++ b/common/log/config.pb.go @@ -98,6 +98,41 @@ func (m *Config) String() string { return proto.CompactTextString(m) func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Config) GetErrorLogType() LogType { + if m != nil { + return m.ErrorLogType + } + return LogType_None +} + +func (m *Config) GetErrorLogLevel() LogLevel { + if m != nil { + return m.ErrorLogLevel + } + return LogLevel_Disabled +} + +func (m *Config) GetErrorLogPath() string { + if m != nil { + return m.ErrorLogPath + } + return "" +} + +func (m *Config) GetAccessLogType() LogType { + if m != nil { + return m.AccessLogType + } + return LogType_None +} + +func (m *Config) GetAccessLogPath() string { + if m != nil { + return m.AccessLogPath + } + return "" +} + func init() { proto.RegisterType((*Config)(nil), "v2ray.core.common.log.Config") proto.RegisterEnum("v2ray.core.common.log.LogType", LogType_name, LogType_value) diff --git a/common/net/destination.pb.go b/common/net/destination.pb.go index bea582eb3..a67863f41 100644 --- a/common/net/destination.pb.go +++ b/common/net/destination.pb.go @@ -24,6 +24,13 @@ func (m *Endpoint) String() string { return proto.CompactTextString(m func (*Endpoint) ProtoMessage() {} func (*Endpoint) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +func (m *Endpoint) GetNetwork() Network { + if m != nil { + return m.Network + } + return Network_Unknown +} + func (m *Endpoint) GetAddress() *IPOrDomain { if m != nil { return m.Address @@ -31,6 +38,13 @@ func (m *Endpoint) GetAddress() *IPOrDomain { return nil } +func (m *Endpoint) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + func init() { proto.RegisterType((*Endpoint)(nil), "v2ray.core.common.net.Endpoint") } diff --git a/common/net/network.pb.go b/common/net/network.pb.go index 56d27eea7..2fe454615 100644 --- a/common/net/network.pb.go +++ b/common/net/network.pb.go @@ -57,6 +57,13 @@ func (m *NetworkList) String() string { return proto.CompactTextStrin func (*NetworkList) ProtoMessage() {} func (*NetworkList) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } +func (m *NetworkList) GetNetwork() []Network { + if m != nil { + return m.Network + } + return nil +} + func init() { proto.RegisterType((*NetworkList)(nil), "v2ray.core.common.net.NetworkList") proto.RegisterEnum("v2ray.core.common.net.Network", Network_name, Network_value) diff --git a/common/net/port.pb.go b/common/net/port.pb.go index 50ba97c87..96eec1ae7 100644 --- a/common/net/port.pb.go +++ b/common/net/port.pb.go @@ -24,6 +24,20 @@ func (m *PortRange) String() string { return proto.CompactTextString( func (*PortRange) ProtoMessage() {} func (*PortRange) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } +func (m *PortRange) GetFrom() uint32 { + if m != nil { + return m.From + } + return 0 +} + +func (m *PortRange) GetTo() uint32 { + if m != nil { + return m.To + } + return 0 +} + func init() { proto.RegisterType((*PortRange)(nil), "v2ray.core.common.net.PortRange") } diff --git a/common/protocol/headers.pb.go b/common/protocol/headers.pb.go index d18bc5a65..d91dd43a0 100644 --- a/common/protocol/headers.pb.go +++ b/common/protocol/headers.pb.go @@ -55,6 +55,13 @@ func (m *SecurityConfig) String() string { return proto.CompactTextSt func (*SecurityConfig) ProtoMessage() {} func (*SecurityConfig) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +func (m *SecurityConfig) GetType() SecurityType { + if m != nil { + return m.Type + } + return SecurityType_UNKNOWN +} + func init() { proto.RegisterType((*SecurityConfig)(nil), "v2ray.core.common.protocol.SecurityConfig") proto.RegisterEnum("v2ray.core.common.protocol.SecurityType", SecurityType_name, SecurityType_value) diff --git a/common/protocol/server_spec.pb.go b/common/protocol/server_spec.pb.go index 0abc558c2..7a6e0d1f3 100644 --- a/common/protocol/server_spec.pb.go +++ b/common/protocol/server_spec.pb.go @@ -32,6 +32,13 @@ func (m *ServerEndpoint) GetAddress() *v2ray_core_common_net1.IPOrDomain { return nil } +func (m *ServerEndpoint) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + func (m *ServerEndpoint) GetUser() []*User { if m != nil { return m.User diff --git a/common/protocol/user.pb.go b/common/protocol/user.pb.go index 74aec1f7b..9b28549c1 100644 --- a/common/protocol/user.pb.go +++ b/common/protocol/user.pb.go @@ -26,6 +26,20 @@ func (m *User) String() string { return proto.CompactTextString(m) } func (*User) ProtoMessage() {} func (*User) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } +func (m *User) GetLevel() uint32 { + if m != nil { + return m.Level + } + return 0 +} + +func (m *User) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + func (m *User) GetAccount() *v2ray_core_common_serial.TypedMessage { if m != nil { return m.Account diff --git a/common/serial/typed_message.pb.go b/common/serial/typed_message.pb.go index f56537214..939ac9dca 100644 --- a/common/serial/typed_message.pb.go +++ b/common/serial/typed_message.pb.go @@ -41,6 +41,20 @@ func (m *TypedMessage) String() string { return proto.CompactTextStri func (*TypedMessage) ProtoMessage() {} func (*TypedMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *TypedMessage) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *TypedMessage) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + func init() { proto.RegisterType((*TypedMessage)(nil), "v2ray.core.common.serial.TypedMessage") } diff --git a/config.go b/config.go index cf0945161..ae78e6a97 100644 --- a/config.go +++ b/config.go @@ -5,18 +5,18 @@ import ( v2net "v2ray.com/core/common/net" ) -func (v *AllocationStrategyConcurrency) GetValue() uint32 { - if v == nil { +func (v *AllocationStrategy) GetConcurrencyValue() uint32 { + if v == nil || v.Concurrency == nil { return 3 } - return v.Value + return v.Concurrency.Value } -func (v *AllocationStrategyRefresh) GetValue() uint32 { - if v == nil { +func (v *AllocationStrategy) GetRefreshValue() uint32 { + if v == nil || v.Refresh == nil { return 5 } - return v.Value + return v.Refresh.Value } func (v *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy { diff --git a/config.pb.go b/config.pb.go index c6d5f4d41..bad7225a1 100644 --- a/config.pb.go +++ b/config.pb.go @@ -97,6 +97,13 @@ func (m *AllocationStrategyConcurrency) String() string { return prot func (*AllocationStrategyConcurrency) ProtoMessage() {} func (*AllocationStrategyConcurrency) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *AllocationStrategyConcurrency) GetValue() uint32 { + if m != nil { + return m.Value + } + return 0 +} + type AllocationStrategyRefresh struct { Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` } @@ -106,6 +113,13 @@ func (m *AllocationStrategyRefresh) String() string { return proto.Co func (*AllocationStrategyRefresh) ProtoMessage() {} func (*AllocationStrategyRefresh) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *AllocationStrategyRefresh) GetValue() uint32 { + if m != nil { + return m.Value + } + return 0 +} + type AllocationStrategy struct { Type AllocationStrategy_Type `protobuf:"varint,1,opt,name=type,enum=v2ray.core.AllocationStrategy_Type" json:"type,omitempty"` // Number of handlers (ports) running in parallel. @@ -121,6 +135,13 @@ func (m *AllocationStrategy) String() string { return proto.CompactTe func (*AllocationStrategy) ProtoMessage() {} func (*AllocationStrategy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *AllocationStrategy) GetType() AllocationStrategy_Type { + if m != nil { + return m.Type + } + return AllocationStrategy_Always +} + func (m *AllocationStrategy) GetConcurrency() *AllocationStrategyConcurrency { if m != nil { return m.Concurrency @@ -176,6 +197,13 @@ func (m *InboundConnectionConfig) GetListenOn() *v2ray_core_common_net1.IPOrDoma return nil } +func (m *InboundConnectionConfig) GetTag() string { + if m != nil { + return m.Tag + } + return "" +} + func (m *InboundConnectionConfig) GetAllocationStrategy() *AllocationStrategy { if m != nil { return m.AllocationStrategy @@ -190,6 +218,13 @@ func (m *InboundConnectionConfig) GetStreamSettings() *v2ray_core_transport_inte return nil } +func (m *InboundConnectionConfig) GetAllowPassiveConnection() bool { + if m != nil { + return m.AllowPassiveConnection + } + return false +} + // Config for an outbound connection handler. type OutboundConnectionConfig struct { Settings *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,1,opt,name=settings" json:"settings,omitempty"` @@ -233,6 +268,13 @@ func (m *OutboundConnectionConfig) GetProxySettings() *v2ray_core_transport_inte return nil } +func (m *OutboundConnectionConfig) GetTag() string { + if m != nil { + return m.Tag + } + return "" +} + type Config struct { // Inbound handler configurations. Must have at least one item. Inbound []*InboundConnectionConfig `protobuf:"bytes,1,rep,name=inbound" json:"inbound,omitempty"` diff --git a/inbound_detour_always.go b/inbound_detour_always.go index 5f3a6060e..e1b5ba6c5 100644 --- a/inbound_detour_always.go +++ b/inbound_detour_always.go @@ -45,7 +45,7 @@ func NewInboundDetourHandlerAlways(space app.Space, config *InboundConnectionCon func (v *InboundDetourHandlerAlways) GetConnectionHandler() (proxy.InboundHandler, int) { ich := v.ich[dice.Roll(len(v.ich))] - return ich, int(v.config.GetAllocationStrategyValue().Refresh.GetValue()) + return ich, int(v.config.GetAllocationStrategyValue().GetRefreshValue()) } func (v *InboundDetourHandlerAlways) Close() { diff --git a/inbound_detour_dynamic.go b/inbound_detour_dynamic.go index 1a4b72a11..439c6b399 100644 --- a/inbound_detour_dynamic.go +++ b/inbound_detour_dynamic.go @@ -28,7 +28,7 @@ func NewInboundDetourHandlerDynamic(space app.Space, config *InboundConnectionCo config: config, portsInUse: make(map[v2net.Port]bool), } - handler.ichs = make([]proxy.InboundHandler, config.GetAllocationStrategyValue().Concurrency.GetValue()) + handler.ichs = make([]proxy.InboundHandler, config.GetAllocationStrategyValue().GetConcurrencyValue()) // To test configuration ichConfig, err := config.GetTypedSettings() @@ -67,7 +67,7 @@ func (v *InboundDetourHandlerDynamic) GetConnectionHandler() (proxy.InboundHandl v.RLock() defer v.RUnlock() ich := v.ichs[dice.Roll(len(v.ichs))] - until := int(v.config.GetAllocationStrategyValue().Refresh.GetValue()) - int((time.Now().Unix()-v.lastRefresh.Unix())/60/1000) + until := int(v.config.GetAllocationStrategyValue().GetRefreshValue()) - int((time.Now().Unix()-v.lastRefresh.Unix())/60/1000) if until < 0 { until = 0 } @@ -101,7 +101,7 @@ func (v *InboundDetourHandlerDynamic) refresh() error { config := v.config v.ich2Recyle = v.ichs - newIchs := make([]proxy.InboundHandler, config.GetAllocationStrategyValue().Concurrency.GetValue()) + newIchs := make([]proxy.InboundHandler, config.GetAllocationStrategyValue().GetConcurrencyValue()) for idx := range newIchs { err := retry.Timed(5, 100).On(func() error { @@ -144,7 +144,7 @@ func (v *InboundDetourHandlerDynamic) Start() error { go func() { for { - time.Sleep(time.Duration(v.config.GetAllocationStrategyValue().Refresh.GetValue())*time.Minute - 1) + time.Sleep(time.Duration(v.config.GetAllocationStrategyValue().GetRefreshValue())*time.Minute - 1) v.RecyleHandles() err := v.refresh() if err != nil { diff --git a/proxy/dokodemo/config.pb.go b/proxy/dokodemo/config.pb.go index a7765f41b..021bfd4fe 100644 --- a/proxy/dokodemo/config.pb.go +++ b/proxy/dokodemo/config.pb.go @@ -50,6 +50,13 @@ func (m *Config) GetAddress() *v2ray_core_common_net.IPOrDomain { return nil } +func (m *Config) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + func (m *Config) GetNetworkList() *v2ray_core_common_net1.NetworkList { if m != nil { return m.NetworkList @@ -57,6 +64,20 @@ func (m *Config) GetNetworkList() *v2ray_core_common_net1.NetworkList { return nil } +func (m *Config) GetTimeout() uint32 { + if m != nil { + return m.Timeout + } + return 0 +} + +func (m *Config) GetFollowRedirect() bool { + if m != nil { + return m.FollowRedirect + } + return false +} + func init() { proto.RegisterType((*Config)(nil), "v2ray.core.proxy.dokodemo.Config") } diff --git a/proxy/freedom/config.pb.go b/proxy/freedom/config.pb.go index 5641269c6..afe40c22f 100644 --- a/proxy/freedom/config.pb.go +++ b/proxy/freedom/config.pb.go @@ -59,6 +59,20 @@ func (m *Config) String() string { return proto.CompactTextString(m) func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Config) GetDomainStrategy() Config_DomainStrategy { + if m != nil { + return m.DomainStrategy + } + return Config_AS_IS +} + +func (m *Config) GetTimeout() uint32 { + if m != nil { + return m.Timeout + } + return 0 +} + func init() { proto.RegisterType((*Config)(nil), "v2ray.core.proxy.freedom.Config") proto.RegisterEnum("v2ray.core.proxy.freedom.Config_DomainStrategy", Config_DomainStrategy_name, Config_DomainStrategy_value) diff --git a/proxy/http/config.pb.go b/proxy/http/config.pb.go index 62d2000c3..d0fc8e8b6 100644 --- a/proxy/http/config.pb.go +++ b/proxy/http/config.pb.go @@ -39,6 +39,13 @@ func (m *ServerConfig) String() string { return proto.CompactTextStri func (*ServerConfig) ProtoMessage() {} func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *ServerConfig) GetTimeout() uint32 { + if m != nil { + return m.Timeout + } + return 0 +} + // ClientConfig for HTTP proxy client. type ClientConfig struct { } diff --git a/proxy/shadowsocks/config.pb.go b/proxy/shadowsocks/config.pb.go index 31e539ee5..16bf92751 100644 --- a/proxy/shadowsocks/config.pb.go +++ b/proxy/shadowsocks/config.pb.go @@ -97,6 +97,27 @@ func (m *Account) String() string { return proto.CompactTextString(m) func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Account) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *Account) GetCipherType() CipherType { + if m != nil { + return m.CipherType + } + return CipherType_UNKNOWN +} + +func (m *Account) GetOta() Account_OneTimeAuth { + if m != nil { + return m.Ota + } + return Account_Auto +} + type ServerConfig struct { UdpEnabled bool `protobuf:"varint,1,opt,name=udp_enabled,json=udpEnabled" json:"udp_enabled,omitempty"` User *v2ray_core_common_protocol.User `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"` @@ -107,6 +128,13 @@ func (m *ServerConfig) String() string { return proto.CompactTextStri func (*ServerConfig) ProtoMessage() {} func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *ServerConfig) GetUdpEnabled() bool { + if m != nil { + return m.UdpEnabled + } + return false +} + func (m *ServerConfig) GetUser() *v2ray_core_common_protocol.User { if m != nil { return m.User diff --git a/proxy/socks/config.pb.go b/proxy/socks/config.pb.go index 9bdcff116..c4db89188 100644 --- a/proxy/socks/config.pb.go +++ b/proxy/socks/config.pb.go @@ -63,6 +63,20 @@ func (m *Account) String() string { return proto.CompactTextString(m) func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Account) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *Account) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + type ServerConfig struct { AuthType AuthType `protobuf:"varint,1,opt,name=auth_type,json=authType,enum=v2ray.core.proxy.socks.AuthType" json:"auth_type,omitempty"` Accounts map[string]string `protobuf:"bytes,2,rep,name=accounts" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` @@ -76,6 +90,13 @@ func (m *ServerConfig) String() string { return proto.CompactTextStri func (*ServerConfig) ProtoMessage() {} func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *ServerConfig) GetAuthType() AuthType { + if m != nil { + return m.AuthType + } + return AuthType_NO_AUTH +} + func (m *ServerConfig) GetAccounts() map[string]string { if m != nil { return m.Accounts @@ -90,6 +111,20 @@ func (m *ServerConfig) GetAddress() *v2ray_core_common_net.IPOrDomain { return nil } +func (m *ServerConfig) GetUdpEnabled() bool { + if m != nil { + return m.UdpEnabled + } + return false +} + +func (m *ServerConfig) GetTimeout() uint32 { + if m != nil { + return m.Timeout + } + return 0 +} + type ClientConfig struct { Server []*v2ray_core_common_protocol1.ServerEndpoint `protobuf:"bytes,1,rep,name=server" json:"server,omitempty"` } diff --git a/proxy/vmess/account.pb.go b/proxy/vmess/account.pb.go index a3a123295..e3f598ca1 100644 --- a/proxy/vmess/account.pb.go +++ b/proxy/vmess/account.pb.go @@ -43,6 +43,20 @@ func (m *Account) String() string { return proto.CompactTextString(m) func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Account) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Account) GetAlterId() uint32 { + if m != nil { + return m.AlterId + } + return 0 +} + func (m *Account) GetSecuritySettings() *v2ray_core_common_protocol.SecurityConfig { if m != nil { return m.SecuritySettings diff --git a/proxy/vmess/inbound/config.pb.go b/proxy/vmess/inbound/config.pb.go index dc48ba28f..377c85e2a 100644 --- a/proxy/vmess/inbound/config.pb.go +++ b/proxy/vmess/inbound/config.pb.go @@ -40,6 +40,13 @@ func (m *DetourConfig) String() string { return proto.CompactTextStri func (*DetourConfig) ProtoMessage() {} func (*DetourConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *DetourConfig) GetTo() string { + if m != nil { + return m.To + } + return "" +} + type DefaultConfig struct { AlterId uint32 `protobuf:"varint,1,opt,name=alter_id,json=alterId" json:"alter_id,omitempty"` Level uint32 `protobuf:"varint,2,opt,name=level" json:"level,omitempty"` @@ -50,6 +57,20 @@ func (m *DefaultConfig) String() string { return proto.CompactTextStr func (*DefaultConfig) ProtoMessage() {} func (*DefaultConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *DefaultConfig) GetAlterId() uint32 { + if m != nil { + return m.AlterId + } + return 0 +} + +func (m *DefaultConfig) GetLevel() uint32 { + if m != nil { + return m.Level + } + return 0 +} + type Config struct { User []*v2ray_core_common_protocol.User `protobuf:"bytes,1,rep,name=user" json:"user,omitempty"` Default *DefaultConfig `protobuf:"bytes,2,opt,name=default" json:"default,omitempty"` diff --git a/transport/internet/config.pb.go b/transport/internet/config.pb.go index 132e88def..7cff76e39 100644 --- a/transport/internet/config.pb.go +++ b/transport/internet/config.pb.go @@ -44,6 +44,13 @@ func (m *NetworkSettings) String() string { return proto.CompactTextS func (*NetworkSettings) ProtoMessage() {} func (*NetworkSettings) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *NetworkSettings) GetNetwork() v2ray_core_common_net.Network { + if m != nil { + return m.Network + } + return v2ray_core_common_net.Network_Unknown +} + func (m *NetworkSettings) GetSettings() *v2ray_core_common_serial.TypedMessage { if m != nil { return m.Settings @@ -65,6 +72,13 @@ func (m *StreamConfig) String() string { return proto.CompactTextStri func (*StreamConfig) ProtoMessage() {} func (*StreamConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *StreamConfig) GetNetwork() v2ray_core_common_net.Network { + if m != nil { + return m.Network + } + return v2ray_core_common_net.Network_Unknown +} + func (m *StreamConfig) GetNetworkSettings() []*NetworkSettings { if m != nil { return m.NetworkSettings @@ -72,6 +86,13 @@ func (m *StreamConfig) GetNetworkSettings() []*NetworkSettings { return nil } +func (m *StreamConfig) GetSecurityType() string { + if m != nil { + return m.SecurityType + } + return "" +} + func (m *StreamConfig) GetSecuritySettings() []*v2ray_core_common_serial.TypedMessage { if m != nil { return m.SecuritySettings @@ -88,6 +109,13 @@ func (m *ProxyConfig) String() string { return proto.CompactTextStrin func (*ProxyConfig) ProtoMessage() {} func (*ProxyConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *ProxyConfig) GetTag() string { + if m != nil { + return m.Tag + } + return "" +} + func init() { proto.RegisterType((*NetworkSettings)(nil), "v2ray.core.transport.internet.NetworkSettings") proto.RegisterType((*StreamConfig)(nil), "v2ray.core.transport.internet.StreamConfig") diff --git a/transport/internet/headers/http/config.go b/transport/internet/headers/http/config.go index 77f609db6..99f015bf1 100644 --- a/transport/internet/headers/http/config.go +++ b/transport/internet/headers/http/config.go @@ -2,37 +2,10 @@ package http import ( "strings" + "v2ray.com/core/common/dice" ) -func (v *Version) GetValue() string { - if v == nil { - return "1.1" - } - return v.Value -} - -func (v *Method) GetValue() string { - if v == nil { - return "GET" - } - return v.Value -} - -func (v *Status) GetCode() string { - if v == nil { - return "200" - } - return v.Code -} - -func (v *Status) GetReason() string { - if v == nil { - return "OK" - } - return v.Reason -} - func pickString(arr []string) string { n := len(arr) switch n { @@ -63,8 +36,22 @@ func (v *RequestConfig) PickHeaders() []string { return headers } +func (v *RequestConfig) GetVersionValue() string { + if v == nil || v.Version == nil { + return "1.1" + } + return v.Version.Value +} + +func (v *RequestConfig) GetMethodValue() string { + if v == nil || v.Method == nil { + return "GET" + } + return v.Method.Value +} + func (v *RequestConfig) GetFullVersion() string { - return "HTTP/" + v.Version.GetValue() + return "HTTP/" + v.GetVersionValue() } func (v *ResponseConfig) HasHeader(header string) bool { @@ -91,6 +78,23 @@ func (v *ResponseConfig) PickHeaders() []string { return headers } -func (v *ResponseConfig) GetFullVersion() string { - return "HTTP/" + v.Version.GetValue() +func (v *ResponseConfig) GetVersionValue() string { + if v == nil || v.Version == nil { + return "1.1" + } + return v.Version.Value +} + +func (v *ResponseConfig) GetFullVersion() string { + return "HTTP/" + v.GetVersionValue() +} + +func (v *ResponseConfig) GetStatusValue() *Status { + if v == nil || v.Status == nil { + return &Status{ + Code: "200", + Reason: "OK", + } + } + return v.Status } diff --git a/transport/internet/headers/http/config.pb.go b/transport/internet/headers/http/config.pb.go index 0f770a078..c7ab3dd8f 100644 --- a/transport/internet/headers/http/config.pb.go +++ b/transport/internet/headers/http/config.pb.go @@ -46,6 +46,20 @@ func (m *Header) String() string { return proto.CompactTextString(m) func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Header) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Header) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + // HTTP version. Default value "1.1". type Version struct { Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` @@ -56,6 +70,13 @@ func (m *Version) String() string { return proto.CompactTextString(m) func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *Version) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + // HTTP method. Default value "GET". type Method struct { Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` @@ -66,6 +87,13 @@ func (m *Method) String() string { return proto.CompactTextString(m) func (*Method) ProtoMessage() {} func (*Method) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *Method) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + type RequestConfig struct { // Full HTTP version like "1.1". Version *Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` @@ -95,6 +123,13 @@ func (m *RequestConfig) GetMethod() *Method { return nil } +func (m *RequestConfig) GetUri() []string { + if m != nil { + return m.Uri + } + return nil +} + func (m *RequestConfig) GetHeader() []*Header { if m != nil { return m.Header @@ -114,6 +149,20 @@ func (m *Status) String() string { return proto.CompactTextString(m) func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (m *Status) GetCode() string { + if m != nil { + return m.Code + } + return "" +} + +func (m *Status) GetReason() string { + if m != nil { + return m.Reason + } + return "" +} + type ResponseConfig struct { Version *Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` Status *Status `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` diff --git a/transport/internet/headers/http/http.go b/transport/internet/headers/http/http.go index 6f54ba8fd..d8c6c79f6 100644 --- a/transport/internet/headers/http/http.go +++ b/transport/internet/headers/http/http.go @@ -191,7 +191,7 @@ func (v *HttpConn) Close() error { func formResponseHeader(config *ResponseConfig) *HeaderWriter { header := buf.NewSmall() - header.AppendSupplier(serial.WriteString(strings.Join([]string{config.GetFullVersion(), config.Status.GetCode(), config.Status.GetReason()}, " "))) + header.AppendSupplier(serial.WriteString(strings.Join([]string{config.GetFullVersion(), config.GetStatusValue().Code, config.GetStatusValue().Reason}, " "))) header.AppendSupplier(writeCRLF) headers := config.PickHeaders() @@ -217,7 +217,7 @@ type HttpAuthenticator struct { func (v HttpAuthenticator) GetClientWriter() *HeaderWriter { header := buf.NewSmall() config := v.config.Request - header.AppendSupplier(serial.WriteString(strings.Join([]string{config.Method.GetValue(), config.PickUri(), config.GetFullVersion()}, " "))) + header.AppendSupplier(serial.WriteString(strings.Join([]string{config.GetMethodValue(), config.PickUri(), config.GetFullVersion()}, " "))) header.AppendSupplier(writeCRLF) headers := config.PickHeaders() diff --git a/transport/internet/headers/srtp/config.pb.go b/transport/internet/headers/srtp/config.pb.go index 5b061aed5..243776b61 100644 --- a/transport/internet/headers/srtp/config.pb.go +++ b/transport/internet/headers/srtp/config.pb.go @@ -42,6 +42,48 @@ func (m *Config) String() string { return proto.CompactTextString(m) func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Config) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *Config) GetPadding() bool { + if m != nil { + return m.Padding + } + return false +} + +func (m *Config) GetExtension() bool { + if m != nil { + return m.Extension + } + return false +} + +func (m *Config) GetCsrcCount() uint32 { + if m != nil { + return m.CsrcCount + } + return 0 +} + +func (m *Config) GetMarker() bool { + if m != nil { + return m.Marker + } + return false +} + +func (m *Config) GetPayloadType() uint32 { + if m != nil { + return m.PayloadType + } + return 0 +} + func init() { proto.RegisterType((*Config)(nil), "v2ray.core.transport.internet.headers.srtp.Config") } diff --git a/transport/internet/headers/utp/config.pb.go b/transport/internet/headers/utp/config.pb.go index d47533836..258f02584 100644 --- a/transport/internet/headers/utp/config.pb.go +++ b/transport/internet/headers/utp/config.pb.go @@ -37,6 +37,13 @@ func (m *Config) String() string { return proto.CompactTextString(m) func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Config) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + func init() { proto.RegisterType((*Config)(nil), "v2ray.core.transport.internet.headers.utp.Config") } diff --git a/transport/internet/kcp/config.go b/transport/internet/kcp/config.go index 9d3cc08b3..2a9abdd06 100644 --- a/transport/internet/kcp/config.go +++ b/transport/internet/kcp/config.go @@ -7,52 +7,52 @@ import ( "v2ray.com/core/transport/internet" ) -// GetValue returns the value of MTU settings. -func (v *MTU) GetValue() uint32 { - if v == nil { +// GetMTUValue returns the value of MTU settings. +func (v *Config) GetMTUValue() uint32 { + if v == nil || v.Mtu == nil { return 1350 } - return v.Value + return v.Mtu.Value } -// GetValue returns the value of TTI settings. -func (v *TTI) GetValue() uint32 { - if v == nil { +// GetTTIValue returns the value of TTI settings. +func (v *Config) GetTTIValue() uint32 { + if v == nil || v.Tti == nil { return 50 } - return v.Value + return v.Tti.Value } -// GetValue returns the value of UplinkCapacity settings. -func (v *UplinkCapacity) GetValue() uint32 { - if v == nil { +// GetUplinkCapacityValue returns the value of UplinkCapacity settings. +func (v *Config) GetUplinkCapacityValue() uint32 { + if v == nil || v.UplinkCapacity == nil { return 5 } - return v.Value + return v.UplinkCapacity.Value } -// GetValue returns the value of DownlinkCapacity settings. -func (v *DownlinkCapacity) GetValue() uint32 { - if v == nil { +// GetDownlinkCapacityValue returns the value of DownlinkCapacity settings. +func (v *Config) GetDownlinkCapacityValue() uint32 { + if v == nil || v.DownlinkCapacity == nil { return 20 } - return v.Value + return v.DownlinkCapacity.Value } -// GetSize returns the size of WriterBuffer in bytes. -func (v *WriteBuffer) GetSize() uint32 { - if v == nil { +// GetWriteBufferSize returns the size of WriterBuffer in bytes. +func (v *Config) GetWriteBufferSize() uint32 { + if v == nil || v.WriteBuffer == nil { return 2 * 1024 * 1024 } - return v.Size + return v.WriteBuffer.Size } -// GetSize returns the size of ReadBuffer in bytes. -func (v *ReadBuffer) GetSize() uint32 { - if v == nil { +// GetReadBufferSize returns the size of ReadBuffer in bytes. +func (v *Config) GetReadBufferSize() uint32 { + if v == nil || v.ReadBuffer == nil { return 2 * 1024 * 1024 } - return v.Size + return v.ReadBuffer.Size } // GetSecurity returns the security settings. @@ -73,7 +73,7 @@ func (v *Config) GetPackerHeader() (internet.PacketHeader, error) { } func (v *Config) GetSendingInFlightSize() uint32 { - size := v.UplinkCapacity.GetValue() * 1024 * 1024 / v.Mtu.GetValue() / (1000 / v.Tti.GetValue()) + size := v.GetUplinkCapacityValue() * 1024 * 1024 / v.GetMTUValue() / (1000 / v.GetTTIValue()) if size < 8 { size = 8 } @@ -81,11 +81,11 @@ func (v *Config) GetSendingInFlightSize() uint32 { } func (v *Config) GetSendingBufferSize() uint32 { - return v.WriteBuffer.GetSize() / v.Mtu.GetValue() + return v.GetWriteBufferSize() / v.GetMTUValue() } func (v *Config) GetReceivingInFlightSize() uint32 { - size := v.DownlinkCapacity.GetValue() * 1024 * 1024 / v.Mtu.GetValue() / (1000 / v.Tti.GetValue()) + size := v.GetDownlinkCapacityValue() * 1024 * 1024 / v.GetMTUValue() / (1000 / v.GetTTIValue()) if size < 8 { size = 8 } @@ -93,14 +93,14 @@ func (v *Config) GetReceivingInFlightSize() uint32 { } func (v *Config) GetReceivingBufferSize() uint32 { - return v.ReadBuffer.GetSize() / v.Mtu.GetValue() + return v.GetReadBufferSize() / v.GetMTUValue() } -func (o *ConnectionReuse) IsEnabled() bool { - if o == nil { +func (v *Config) IsConnectionReuse() bool { + if v == nil || v.ConnectionReuse == nil { return true } - return o.Enable + return v.ConnectionReuse.Enable } func init() { diff --git a/transport/internet/kcp/config.pb.go b/transport/internet/kcp/config.pb.go index e6d20742e..5cca8d8f3 100644 --- a/transport/internet/kcp/config.pb.go +++ b/transport/internet/kcp/config.pb.go @@ -46,6 +46,13 @@ func (m *MTU) String() string { return proto.CompactTextString(m) } func (*MTU) ProtoMessage() {} func (*MTU) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *MTU) GetValue() uint32 { + if m != nil { + return m.Value + } + return 0 +} + // Transmission Time Interview, in milli-sec. type TTI struct { Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` @@ -56,6 +63,13 @@ func (m *TTI) String() string { return proto.CompactTextString(m) } func (*TTI) ProtoMessage() {} func (*TTI) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *TTI) GetValue() uint32 { + if m != nil { + return m.Value + } + return 0 +} + // Uplink capacity, in MB. type UplinkCapacity struct { Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` @@ -66,6 +80,13 @@ func (m *UplinkCapacity) String() string { return proto.CompactTextSt func (*UplinkCapacity) ProtoMessage() {} func (*UplinkCapacity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *UplinkCapacity) GetValue() uint32 { + if m != nil { + return m.Value + } + return 0 +} + // Downlink capacity, in MB. type DownlinkCapacity struct { Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` @@ -76,6 +97,13 @@ func (m *DownlinkCapacity) String() string { return proto.CompactText func (*DownlinkCapacity) ProtoMessage() {} func (*DownlinkCapacity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (m *DownlinkCapacity) GetValue() uint32 { + if m != nil { + return m.Value + } + return 0 +} + type WriteBuffer struct { // Buffer size in bytes. Size uint32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` @@ -86,6 +114,13 @@ func (m *WriteBuffer) String() string { return proto.CompactTextStrin func (*WriteBuffer) ProtoMessage() {} func (*WriteBuffer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (m *WriteBuffer) GetSize() uint32 { + if m != nil { + return m.Size + } + return 0 +} + type ReadBuffer struct { // Buffer size in bytes. Size uint32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` @@ -96,6 +131,13 @@ func (m *ReadBuffer) String() string { return proto.CompactTextString func (*ReadBuffer) ProtoMessage() {} func (*ReadBuffer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (m *ReadBuffer) GetSize() uint32 { + if m != nil { + return m.Size + } + return 0 +} + type ConnectionReuse struct { Enable bool `protobuf:"varint,1,opt,name=enable" json:"enable,omitempty"` } @@ -105,6 +147,13 @@ func (m *ConnectionReuse) String() string { return proto.CompactTextS func (*ConnectionReuse) ProtoMessage() {} func (*ConnectionReuse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (m *ConnectionReuse) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + type Config struct { Mtu *MTU `protobuf:"bytes,1,opt,name=mtu" json:"mtu,omitempty"` Tti *TTI `protobuf:"bytes,2,opt,name=tti" json:"tti,omitempty"` @@ -150,6 +199,13 @@ func (m *Config) GetDownlinkCapacity() *DownlinkCapacity { return nil } +func (m *Config) GetCongestion() bool { + if m != nil { + return m.Congestion + } + return false +} + func (m *Config) GetWriteBuffer() *WriteBuffer { if m != nil { return m.WriteBuffer diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index e44254cdc..36f851d47 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -209,10 +209,10 @@ func NewConnection(conv uint16, sysConn SystemConnection, recycler internal.Conn dataOutput: make(chan bool, 1), Config: config, output: NewSegmentWriter(sysConn), - mss: config.GetMtu().GetValue() - uint32(sysConn.Overhead()) - DataSegmentOverhead, + mss: config.GetMTUValue() - uint32(sysConn.Overhead()) - DataSegmentOverhead, roundTrip: &RoundTripInfo{ rto: 100, - minRtt: config.Tti.GetValue(), + minRtt: config.GetTTIValue(), }, } sysConn.Reset(conn.Input) @@ -227,7 +227,7 @@ func NewConnection(conv uint16, sysConn SystemConnection, recycler internal.Conn return conn.State() == StateTerminated } conn.dataUpdater = NewUpdater( - config.Tti.GetValue(), + config.GetTTIValue(), predicate.Not(isTerminating).And(predicate.Any(conn.sendingWorker.UpdateNecessary, conn.receivingWorker.UpdateNecessary)), isTerminating, conn.updateTask) @@ -439,7 +439,7 @@ func (v *Connection) updateTask() { } func (v *Connection) Reusable() bool { - return v.Config.ConnectionReuse.IsEnabled() && v.reusable + return v.Config.IsConnectionReuse() && v.reusable } func (v *Connection) SetReusable(b bool) { @@ -456,7 +456,7 @@ func (v *Connection) Terminate() { v.OnDataInput() v.OnDataOutput() - if v.Config.ConnectionReuse.IsEnabled() && v.reusable { + if v.Config.IsConnectionReuse() && v.reusable { v.connRecycler.Put(v.conn.Id(), v.conn) } else { v.conn.Close() diff --git a/transport/internet/tcp/config.pb.go b/transport/internet/tcp/config.pb.go index 43724ca7e..35319925f 100644 --- a/transport/internet/tcp/config.pb.go +++ b/transport/internet/tcp/config.pb.go @@ -39,6 +39,13 @@ func (m *ConnectionReuse) String() string { return proto.CompactTextS func (*ConnectionReuse) ProtoMessage() {} func (*ConnectionReuse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *ConnectionReuse) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + type Config struct { ConnectionReuse *ConnectionReuse `protobuf:"bytes,1,opt,name=connection_reuse,json=connectionReuse" json:"connection_reuse,omitempty"` HeaderSettings *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,2,opt,name=header_settings,json=headerSettings" json:"header_settings,omitempty"` diff --git a/transport/internet/tls/config.pb.go b/transport/internet/tls/config.pb.go index 664d38abb..e13efaeeb 100644 --- a/transport/internet/tls/config.pb.go +++ b/transport/internet/tls/config.pb.go @@ -41,6 +41,20 @@ func (m *Certificate) String() string { return proto.CompactTextStrin func (*Certificate) ProtoMessage() {} func (*Certificate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *Certificate) GetCertificate() []byte { + if m != nil { + return m.Certificate + } + return nil +} + +func (m *Certificate) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + type Config struct { // Whether or not to allow self-signed certificates. AllowInsecure bool `protobuf:"varint,1,opt,name=allow_insecure,json=allowInsecure" json:"allow_insecure,omitempty"` @@ -55,6 +69,13 @@ func (m *Config) String() string { return proto.CompactTextString(m) func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *Config) GetAllowInsecure() bool { + if m != nil { + return m.AllowInsecure + } + return false +} + func (m *Config) GetCertificate() []*Certificate { if m != nil { return m.Certificate @@ -62,6 +83,13 @@ func (m *Config) GetCertificate() []*Certificate { return nil } +func (m *Config) GetServerName() string { + if m != nil { + return m.ServerName + } + return "" +} + func init() { proto.RegisterType((*Certificate)(nil), "v2ray.core.transport.internet.tls.Certificate") proto.RegisterType((*Config)(nil), "v2ray.core.transport.internet.tls.Config") diff --git a/transport/internet/websocket/config.pb.go b/transport/internet/websocket/config.pb.go index bd91332b8..72a1bfeb3 100644 --- a/transport/internet/websocket/config.pb.go +++ b/transport/internet/websocket/config.pb.go @@ -38,6 +38,13 @@ func (m *ConnectionReuse) String() string { return proto.CompactTextS func (*ConnectionReuse) ProtoMessage() {} func (*ConnectionReuse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *ConnectionReuse) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + type Config struct { // Whether or not to reuse WebSocket connections. ConnectionReuse *ConnectionReuse `protobuf:"bytes,1,opt,name=connection_reuse,json=connectionReuse" json:"connection_reuse,omitempty"` @@ -57,6 +64,13 @@ func (m *Config) GetConnectionReuse() *ConnectionReuse { return nil } +func (m *Config) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + func init() { proto.RegisterType((*ConnectionReuse)(nil), "v2ray.core.transport.internet.websocket.ConnectionReuse") proto.RegisterType((*Config)(nil), "v2ray.core.transport.internet.websocket.Config")