diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 12:11:30 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 14:10:57 +0300 |
| commit | 37c17357fc45b9acec387f3097be5db074ce880d (patch) | |
| tree | a3a5aa82c7483c0883070185372c491537173c25 /sub/subService.go | |
| parent | b35d33966589f428053b77f51a92ec0214bd92fb (diff) | |
undo vnext for vmess
Diffstat (limited to 'sub/subService.go')
| -rw-r--r-- | sub/subService.go | 13 |
1 files changed, 7 insertions, 6 deletions
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) |
