diff options
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) |
