new: add vpn service mode as seperated option, fix crash of wireguard in wireguard and more stable wireguard

This commit is contained in:
Hiddify
2024-02-14 15:49:47 +01:00
parent 43d9ef9bbd
commit 3111671d6e
7 changed files with 76 additions and 70 deletions

View File

@@ -105,17 +105,17 @@ func patchOutboundFragment(base option.Outbound, configOpt ConfigOptions, obj ou
func isOutboundReality(base option.Outbound) bool {
// this function checks reality status ONLY FOR VLESS.
// Some other protocols can also use reality, but it's discouraged as stated in the reality document
isReality := false
switch base.Type {
case C.TypeVLESS:
if base.VLESSOptions.OutboundTLSOptionsContainer.TLS == nil {
return false
}
if base.VLESSOptions.OutboundTLSOptionsContainer.TLS.Reality != nil {
isReality = base.VLESSOptions.OutboundTLSOptionsContainer.TLS.Reality.Enabled
}
if base.Type != C.TypeVLESS {
return false
}
return isReality
if base.VLESSOptions.OutboundTLSOptionsContainer.TLS == nil {
return false
}
if base.VLESSOptions.OutboundTLSOptionsContainer.TLS.Reality == nil {
return false
}
return base.VLESSOptions.OutboundTLSOptionsContainer.TLS.Reality.Enabled
}
func patchOutbound(base option.Outbound, configOpt ConfigOptions) (*option.Outbound, string, error) {