From 37c17357fc45b9acec387f3097be5db074ce880d Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 20 Sep 2025 11:11:30 +0200 Subject: undo vnext for vmess --- sub/subService.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sub/subService.go') diff --git a/sub/subService.go b/sub/subService.go index 9f28b35b..6204fdee 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -321,9 +321,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { if inbound.Protocol != model.VLESS { return "" } - var vlessSettings model.VLESSSettings - _ = json.Unmarshal([]byte(inbound.Settings), &vlessSettings) - var stream map[string]any json.Unmarshal([]byte(inbound.StreamSettings), &stream) clients, _ := s.inboundService.GetClients(inbound) @@ -338,11 +335,15 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { port := inbound.Port streamNetwork := stream["network"].(string) params := make(map[string]string) - if vlessSettings.Encryption != "" { - params["encryption"] = vlessSettings.Encryption - } params["type"] = streamNetwork + // Add encryption parameter for VLESS from inbound settings + var settings map[string]any + json.Unmarshal([]byte(inbound.Settings), &settings) + if encryption, ok := settings["encryption"].(string); ok { + params["encryption"] = encryption + } + switch streamNetwork { case "tcp": tcp, _ := stream["tcpSettings"].(map[string]any) -- cgit v1.2.3