From fb4d3c41c81c378d7b1c680bf4941cccf9f77ffa Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:03:24 +0800 Subject: [PATCH] chore: simplify VlessFlow Option --- adapter/outbound/vless.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/adapter/outbound/vless.go b/adapter/outbound/vless.go index 43b4aa214a..b18bf4dac6 100644 --- a/adapter/outbound/vless.go +++ b/adapter/outbound/vless.go @@ -505,17 +505,14 @@ func NewVless(option VlessOption) (*Vless, error) { var addons *vless.Addons if option.Network != "ws" && len(option.Flow) >= 16 { option.Flow = option.Flow[:16] - switch option.Flow { - case vless.XRV: - log.Warnln("To use %s, ensure your server is upgrade to Xray-core v1.8.0+", vless.XRV) - addons = &vless.Addons{ - Flow: option.Flow, - } - case vless.XRO, vless.XRD, vless.XRS: - log.Fatalln("Legacy XTLS protocol %s is deprecated and no longer supported", option.Flow) - default: + if option.Flow != vless.XRV { return nil, fmt.Errorf("unsupported xtls flow type: %s", option.Flow) } + + log.Warnln("To use %s, ensure your server is upgrade to Xray-core v1.8.0+", vless.XRV) + addons = &vless.Addons{ + Flow: option.Flow, + } } switch option.PacketEncoding {