mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
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:
parent
dbcbb519e3
commit
f2cb13a8ec
3 changed files with 31 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue