From 308a106facf6229585d1ee571e4103648b59c897 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Fri, 26 Jan 2024 18:33:16 +0100 Subject: [PATCH] fix bug in: fragment --- config/outbound.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/outbound.go b/config/outbound.go index b38db00..fbd7a3f 100644 --- a/config/outbound.go +++ b/config/outbound.go @@ -35,11 +35,11 @@ func patchOutboundTLSTricks(base option.Outbound, configOpt ConfigOptions, obj o } var tls *option.OutboundTLSOptions - if base.VLESSOptions.OutboundTLSOptionsContainer.TLS == nil { + if base.VLESSOptions.OutboundTLSOptionsContainer.TLS != nil { tls = base.VLESSOptions.OutboundTLSOptionsContainer.TLS - } else if base.TrojanOptions.OutboundTLSOptionsContainer.TLS == nil { + } else if base.TrojanOptions.OutboundTLSOptionsContainer.TLS != nil { tls = base.TrojanOptions.OutboundTLSOptionsContainer.TLS - } else if base.VMessOptions.OutboundTLSOptionsContainer.TLS == nil { + } else if base.VMessOptions.OutboundTLSOptionsContainer.TLS != nil { tls = base.VMessOptions.OutboundTLSOptionsContainer.TLS } if tls == nil || !tls.Enabled { @@ -150,6 +150,7 @@ func patchWarp(base *option.Outbound) error { key, _ := warp["key"].(string) host, _ := warp["host"].(string) port, _ := warp["port"].(float64) + detour, _ := warp["detour"].(string) fakePackets, _ := warp["fake_packets"].(string) warpConfig, err := generateWarp(key, host, uint16(port), fakePackets) if err != nil { @@ -158,6 +159,7 @@ func patchWarp(base *option.Outbound) error { } base.Type = C.TypeWireGuard + warpConfig.WireGuardOptions.Detour = detour base.WireGuardOptions = warpConfig.WireGuardOptions }