fix: Tolerance 50ms + InterruptExistConnections false
Some checks failed
CI / run (push) Has been cancelled
Some checks failed
CI / run (push) Has been cancelled
- URLTest Tolerance: 1 → 50 (стабильный автовыбор без дёрганий) - InterruptExistConnections: true → false для URLTest и Selector - Критично: предотвращает разрывы YouTube/загрузок при смене сервера - Протестировано: streams продолжаются без прерываний
This commit is contained in:
@@ -202,9 +202,9 @@ func setOutbounds(options *option.Options, input *option.Options, opt *HiddifyOp
|
|||||||
URL: opt.ConnectionTestUrl,
|
URL: opt.ConnectionTestUrl,
|
||||||
Interval: option.Duration(opt.URLTestInterval.Duration()),
|
Interval: option.Duration(opt.URLTestInterval.Duration()),
|
||||||
// IdleTimeout: option.Duration(opt.URLTestIdleTimeout.Duration()),
|
// IdleTimeout: option.Duration(opt.URLTestIdleTimeout.Duration()),
|
||||||
Tolerance: 1,
|
Tolerance: 50,
|
||||||
IdleTimeout: option.Duration(opt.URLTestInterval.Duration().Nanoseconds() * 3),
|
IdleTimeout: option.Duration(opt.URLTestInterval.Duration().Nanoseconds() * 3),
|
||||||
InterruptExistConnections: true,
|
InterruptExistConnections: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
defaultSelect := urlTest.Tag
|
defaultSelect := urlTest.Tag
|
||||||
@@ -220,7 +220,7 @@ func setOutbounds(options *option.Options, input *option.Options, opt *HiddifyOp
|
|||||||
SelectorOptions: option.SelectorOutboundOptions{
|
SelectorOptions: option.SelectorOutboundOptions{
|
||||||
Outbounds: append([]string{urlTest.Tag}, tags...),
|
Outbounds: append([]string{urlTest.Tag}, tags...),
|
||||||
Default: defaultSelect,
|
Default: defaultSelect,
|
||||||
InterruptExistConnections: true,
|
InterruptExistConnections: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,13 +495,13 @@ func setRoutingOptions(options *option.Options, opt *HiddifyOptions) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Per-App Proxy for Desktop platforms (Windows, Linux, macOS)
|
// Per-App Proxy for Desktop platforms (Windows, Linux, macOS)
|
||||||
if runtime.GOOS != "android" {
|
if runtime.GOOS != "android" {
|
||||||
if opt.PerAppProxyOptions.Mode == "include" && len(opt.PerAppProxyOptions.IncludedApplications) > 0 {
|
if opt.PerAppProxyOptions.Mode == "include" && len(opt.PerAppProxyOptions.IncludedApplications) > 0 {
|
||||||
// Mode: Only selected apps use VPN
|
// Mode: Only selected apps use VPN
|
||||||
log.Info("[Per-App] Mode: include - ", len(opt.PerAppProxyOptions.IncludedApplications), " apps will use VPN")
|
log.Info("[Per-App] Mode: include - ", len(opt.PerAppProxyOptions.IncludedApplications), " apps will use VPN")
|
||||||
|
|
||||||
// Rule 1: Selected apps → VPN
|
// Rule 1: Selected apps → VPN
|
||||||
routeRules = append(
|
routeRules = append(
|
||||||
routeRules,
|
routeRules,
|
||||||
@@ -513,7 +513,7 @@ func setRoutingOptions(options *option.Options, opt *HiddifyOptions) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
// Rule 2: All other apps → Direct
|
// Rule 2: All other apps → Direct
|
||||||
routeRules = append(
|
routeRules = append(
|
||||||
routeRules,
|
routeRules,
|
||||||
@@ -527,7 +527,7 @@ func setRoutingOptions(options *option.Options, opt *HiddifyOptions) {
|
|||||||
} else if opt.PerAppProxyOptions.Mode == "exclude" && len(opt.PerAppProxyOptions.ExcludedApplications) > 0 {
|
} else if opt.PerAppProxyOptions.Mode == "exclude" && len(opt.PerAppProxyOptions.ExcludedApplications) > 0 {
|
||||||
// Mode: Excluded apps DON'T use VPN
|
// Mode: Excluded apps DON'T use VPN
|
||||||
log.Info("[Per-App] Mode: exclude - ", len(opt.PerAppProxyOptions.ExcludedApplications), " apps will bypass VPN")
|
log.Info("[Per-App] Mode: exclude - ", len(opt.PerAppProxyOptions.ExcludedApplications), " apps will bypass VPN")
|
||||||
|
|
||||||
// Rule: Excluded apps → Direct (rest goes through VPN by default)
|
// Rule: Excluded apps → Direct (rest goes through VPN by default)
|
||||||
routeRules = append(
|
routeRules = append(
|
||||||
routeRules,
|
routeRules,
|
||||||
@@ -541,7 +541,7 @@ func setRoutingOptions(options *option.Options, opt *HiddifyOptions) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
routeRules = append(routeRules, option.Rule{
|
routeRules = append(routeRules, option.Rule{
|
||||||
Type: C.RuleTypeDefault,
|
Type: C.RuleTypeDefault,
|
||||||
DefaultOptions: option.DefaultRule{
|
DefaultOptions: option.DefaultRule{
|
||||||
|
|||||||
Reference in New Issue
Block a user