mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-14 18:09:05 +00:00
VLESS Encryption: Randomize seconds in ticket and simplify expiration mechanism
https://github.com/XTLS/Xray-core/pull/5067#issuecomment-3246925902
This commit is contained in:
+9
-7
@@ -96,16 +96,18 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
|
||||
default:
|
||||
return false
|
||||
}
|
||||
if s[2] != "1rtt" {
|
||||
t := strings.TrimSuffix(s[2], "s")
|
||||
if t == s[2] {
|
||||
return false
|
||||
}
|
||||
i, err := strconv.Atoi(t)
|
||||
t := strings.SplitN(strings.TrimSuffix(s[2], "s"), "-", 2)
|
||||
i, err := strconv.Atoi(t[0])
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
config.SecondsFrom = uint32(i)
|
||||
if len(t) > 1 {
|
||||
i, err := strconv.Atoi(t[1])
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
config.Seconds = uint32(i)
|
||||
config.SecondsTo = uint32(i)
|
||||
}
|
||||
padding := 0
|
||||
for _, r := range s[3:] {
|
||||
|
||||
Reference in New Issue
Block a user