mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
parent
bf4b1fab3c
commit
9112cfd39c
25 changed files with 150 additions and 761 deletions
|
@ -15,7 +15,6 @@ import (
|
|||
|
||||
type VMessAccount struct {
|
||||
ID string `json:"id"`
|
||||
AlterIds uint16 `json:"alterId"`
|
||||
Security string `json:"security"`
|
||||
Experiments string `json:"experiments"`
|
||||
}
|
||||
|
@ -39,7 +38,6 @@ func (a *VMessAccount) Build() *vmess.Account {
|
|||
}
|
||||
return &vmess.Account{
|
||||
Id: a.ID,
|
||||
AlterId: uint32(a.AlterIds),
|
||||
SecuritySettings: &protocol.SecurityConfig{
|
||||
Type: st,
|
||||
},
|
||||
|
@ -63,14 +61,12 @@ type FeaturesConfig struct {
|
|||
}
|
||||
|
||||
type VMessDefaultConfig struct {
|
||||
AlterIDs uint16 `json:"alterId"`
|
||||
Level byte `json:"level"`
|
||||
}
|
||||
|
||||
// Build implements Buildable
|
||||
func (c *VMessDefaultConfig) Build() *inbound.DefaultConfig {
|
||||
config := new(inbound.DefaultConfig)
|
||||
config.AlterId = uint32(c.AlterIDs)
|
||||
config.Level = uint32(c.Level)
|
||||
return config
|
||||
}
|
||||
|
@ -80,14 +76,11 @@ type VMessInboundConfig struct {
|
|||
Features *FeaturesConfig `json:"features"`
|
||||
Defaults *VMessDefaultConfig `json:"default"`
|
||||
DetourConfig *VMessDetourConfig `json:"detour"`
|
||||
SecureOnly bool `json:"disableInsecureEncryption"`
|
||||
}
|
||||
|
||||
// Build implements Buildable
|
||||
func (c *VMessInboundConfig) Build() (proto.Message, error) {
|
||||
config := &inbound.Config{
|
||||
SecureEncryptionOnly: c.SecureOnly,
|
||||
}
|
||||
config := &inbound.Config{}
|
||||
|
||||
if c.Defaults != nil {
|
||||
config.Default = c.Defaults.Build()
|
||||
|
|
|
@ -105,7 +105,6 @@ func TestVMessInbound(t *testing.T) {
|
|||
Detour: &inbound.DetourConfig{
|
||||
To: "tag_to_detour",
|
||||
},
|
||||
SecureEncryptionOnly: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue