Skip to content

Commit

Permalink
chore: simplify VlessFlow Option
Browse files Browse the repository at this point in the history
  • Loading branch information
Larvan2 committed Sep 17, 2024
1 parent e33d4a4 commit fb4d3c4
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions adapter/outbound/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fb4d3c4

Please sign in to comment.