From e8ba8dc2cb68e38f18e71038b291bfee4ca05b1c Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 15 Aug 2025 02:04:46 +0400 Subject: [PATCH] feat: add option to set default flow. --- infra/conf/vless.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 5d4ace6f..05024c69 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -29,9 +29,10 @@ type VLessInboundFallback struct { } type VLessInboundConfig struct { - Clients []json.RawMessage `json:"clients"` - Decryption string `json:"decryption"` - Fallbacks []*VLessInboundFallback `json:"fallbacks"` + Clients []json.RawMessage `json:"clients"` + Decryption string `json:"decryption"` + Fallbacks []*VLessInboundFallback `json:"fallbacks"` + DefaultFlow string `json:"defaultFlow"` } // Build implements Buildable @@ -55,7 +56,9 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { account.Id = u.String() switch account.Flow { - case "", vless.XRV: + case "": + account.Flow = c.DefaultFlow + case vless.XRV: default: return nil, errors.New(`VLESS clients: "flow" doesn't support "` + account.Flow + `" in this version`) }