1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-08 13:39:08 -04:00

support security = "auto"

This commit is contained in:
Darien Raymond
2016-12-11 14:58:53 +01:00
parent 792e8ffd20
commit d0b301594d
7 changed files with 97 additions and 48 deletions

View File

@@ -39,6 +39,6 @@ func (v *Account) AsAccount() (protocol.Account, error) {
return &InternalAccount{
ID: protoId,
AlterIDs: protocol.NewAlterIDs(protoId, uint16(v.AlterId)),
Security: protocol.Security(v.Security),
Security: v.SecuritySettings.AsSecurity(),
}, nil
}

View File

@@ -30,9 +30,9 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Account struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
AlterId uint32 `protobuf:"varint,2,opt,name=alter_id,json=alterId" json:"alter_id,omitempty"`
Security v2ray_core_common_protocol.SecurityType `protobuf:"varint,3,opt,name=security,enum=v2ray.core.common.protocol.SecurityType" json:"security,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
AlterId uint32 `protobuf:"varint,2,opt,name=alter_id,json=alterId" json:"alter_id,omitempty"`
SecuritySettings *v2ray_core_common_protocol.SecurityConfig `protobuf:"bytes,3,opt,name=security_settings,json=securitySettings" json:"security_settings,omitempty"`
}
func (m *Account) Reset() { *m = Account{} }
@@ -40,6 +40,13 @@ func (m *Account) String() string { return proto.CompactTextString(m)
func (*Account) ProtoMessage() {}
func (*Account) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Account) GetSecuritySettings() *v2ray_core_common_protocol.SecurityConfig {
if m != nil {
return m.SecuritySettings
}
return nil
}
func init() {
proto.RegisterType((*Account)(nil), "v2ray.core.proxy.vmess.Account")
}
@@ -47,19 +54,20 @@ func init() {
func init() { proto.RegisterFile("v2ray.com/core/proxy/vmess/account.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 217 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00,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 0xbb,
0x1e, 0xbf, 0x2d, 0x2f, 0xc7, 0xe5, 0xf3, 0xed, 0xa4, 0x38, 0x6f, 0xbf, 0x02, 0x00, 0x00, 0xff,
0xff, 0x9c, 0x9c, 0x82, 0x1b, 0x27, 0x01, 0x00, 0x00,
// 233 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0xcf, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0x06, 0x70, 0x36, 0xa2, 0xd5, 0xf5, 0x0f, 0x9a, 0x83, 0xc4, 0x9e, 0x82, 0xa7, 0x20, 0x32,
0x8b, 0xf5, 0x09, 0xac, 0x27, 0x6f, 0x92, 0x1e, 0x04, 0x2f, 0x25, 0xce, 0x8e, 0x75, 0xa1, 0x9b,
0x29, 0xb3, 0xdb, 0x62, 0x1e, 0xc2, 0x77, 0x16, 0x37, 0x09, 0x88, 0x78, 0xdc, 0xe5, 0x9b, 0xdf,
0x7c, 0xa3, 0xab, 0xdd, 0x4c, 0x9a, 0x0e, 0x90, 0xbd, 0x41, 0x16, 0x32, 0x1b, 0xe1, 0xcf, 0xce,
0xec, 0x3c, 0x85, 0x60, 0x1a, 0x44, 0xde, 0xb6, 0x11, 0x36, 0xc2, 0x91, 0xf3, 0xcb, 0x31, 0x29,
0x04, 0x29, 0x05, 0x29, 0x35, 0xbd, 0xfd, 0x23, 0x20, 0x7b, 0xcf, 0xad, 0x49, 0x43, 0xc8, 0x6b,
0xf3, 0x41, 0x8d, 0x25, 0x09, 0xbd, 0x72, 0xfd, 0xa5, 0xf4, 0xe4, 0xa1, 0x77, 0xf3, 0x33, 0x9d,
0x39, 0x5b, 0xa8, 0x52, 0x55, 0x47, 0x75, 0xe6, 0x6c, 0x7e, 0xa5, 0x0f, 0x9b, 0x75, 0x24, 0x59,
0x3a, 0x5b, 0x64, 0xa5, 0xaa, 0x4e, 0xeb, 0x49, 0x7a, 0x3f, 0xd9, 0xfc, 0x45, 0x5f, 0x04, 0xc2,
0xad, 0xb8, 0xd8, 0x2d, 0x03, 0xc5, 0xe8, 0xda, 0x55, 0x28, 0xf6, 0x4a, 0x55, 0x1d, 0xcf, 0x6e,
0xe0, 0x57, 0xb1, 0x7e, 0x39, 0x8c, 0xcb, 0x61, 0x31, 0x0c, 0x3d, 0x72, 0xfb, 0xee, 0x56, 0xf5,
0xf9, 0x88, 0x2c, 0x06, 0x63, 0x7e, 0xa7, 0xa7, 0xc8, 0x1e, 0xfe, 0xbf, 0x6d, 0x7e, 0x32, 0x54,
0x7d, 0xfe, 0xf1, 0x5e, 0xf7, 0xd3, 0xe7, 0xdb, 0x41, 0xd2, 0xef, 0xbf, 0x03, 0x00, 0x00, 0xff,
0xff, 0xd1, 0x70, 0xc9, 0x65, 0x3b, 0x01, 0x00, 0x00,
}

View File

@@ -11,5 +11,5 @@ import "v2ray.com/core/common/protocol/headers.proto";
message Account {
string id = 1;
uint32 alter_id = 2;
v2ray.core.common.protocol.SecurityType security = 3;
v2ray.core.common.protocol.SecurityConfig security_settings = 3;
}