Deprecate legacy VMess header with a planned decommission (#712)

* Deprecate legacy VMess header with a planned decommission
* show legacy warning only once

Co-authored-by: Xiaokang Wang <xiaokangwang@outlook.com>
Co-authored-by: hmol233 <82594500+hmol233@users.noreply.github.com>
This commit is contained in:
yuhan6665 2021-09-20 02:46:05 -04:00 committed by GitHub
parent dbcbb519e3
commit f2cb13a8ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View file

@ -31,6 +31,7 @@ import (
var (
aeadForced = false
aeadForced2022 = false
)
type userByEmail struct {
@ -368,8 +369,17 @@ func init() {
return New(ctx, config.(*Config))
}))
const defaultFlagValue = "NOT_DEFINED_AT_ALL"
var defaultFlagValue = "NOT_DEFINED_AT_ALL"
if time.Now().Year() >= 2022 {
defaultFlagValue = "true_by_default_2022"
}
isAeadForced := platform.NewEnvFlag("xray.vmess.aead.forced").GetValue(func() string { return defaultFlagValue })
aeadForced = (isAeadForced == "true")
if isAeadForced == "true_by_default_2022" {
aeadForced = true
aeadForced2022 = true
}
}