fix(sub): default VLESS client encryption to none when the inbound has none stored (#6781)

VLESS inbounds whose settings carry no "encryption" key (rows saved by
panels before the field existed, or inbounds added over the API with only
"decryption":"none", as the API docs example does) produced a JSON
subscription outbound with "encryption": "". Xray refuses to load that
config ("VLESS users: please add/set \"encryption\":\"none\" for every
user"), so every VLESS entry of the JSON subscription was unusable. The
share link left the parameter out instead.

Treat a missing or empty value as "none" for both outputs, matching the
frontend inbound schema default and the docs link generator.
This commit is contained in:
Jay Hemnani
2026-10-12 14:33:47 +05:30
committed by GitHub
parent f55938ba0a
commit d43e0c7ead
3 changed files with 44 additions and 9 deletions
+1 -5
View File
@@ -885,15 +885,11 @@ func (s *SubJsonService) genVless(subReq *SubService, inbound *model.Inbound, st
}
outbound.StreamSettings = streamSettings
// Add encryption for VLESS outbound from inbound settings
inboundSettings := subReq.linkSettings(inbound)
encryption, _ := inboundSettings["encryption"].(string)
settings := map[string]any{
"address": inbound.Listen,
"port": inbound.Port,
"id": client.ID,
"encryption": encryption,
"encryption": vlessClientEncryption(subReq.linkSettings(inbound)),
"level": 8,
}
if client.Flow != "" && !inbound.DisableFlow {