This commit is contained in:
Hiddify
2024-08-06 12:55:18 -04:00
parent 05d76a96a0
commit ebfea88cff

View File

@@ -309,7 +309,9 @@ func setInbound(options *option.Options, opt *ConfigOptions) {
tunInbound := option.Inbound{ tunInbound := option.Inbound{
Type: C.TypeTun, Type: C.TypeTun,
Tag: InboundTUNTag, Tag: InboundTUNTag,
TunOptions: option.TunInboundOptions{ TunOptions: option.TunInboundOptions{
Stack: opt.TUNStack, Stack: opt.TUNStack,
MTU: opt.MTU, MTU: opt.MTU,
AutoRoute: true, AutoRoute: true,
@@ -318,7 +320,7 @@ func setInbound(options *option.Options, opt *ConfigOptions) {
// GSO: runtime.GOOS != "windows", // GSO: runtime.GOOS != "windows",
InboundOptions: option.InboundOptions{ InboundOptions: option.InboundOptions{
SniffEnabled: true, SniffEnabled: true,
SniffOverrideDestination: true, SniffOverrideDestination: false,
DomainStrategy: inboundDomainStrategy, DomainStrategy: inboundDomainStrategy,
}, },
}, },
@@ -496,6 +498,16 @@ func setRoutingOptions(options *option.Options, opt *ConfigOptions) {
}, },
}, },
) )
routeRules = append(
routeRules,
option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{
PackageName: []string{"app.hiddify.com"},
Outbound: OutboundBypassTag,
},
},
)
} }
// { // {
// Type: C.RuleTypeDefault, // Type: C.RuleTypeDefault,
@@ -534,7 +546,7 @@ func setRoutingOptions(options *option.Options, opt *ConfigOptions) {
case "block": case "block":
routeRule.Outbound = OutboundBlockTag routeRule.Outbound = OutboundBlockTag
case "proxy": case "proxy":
routeRule.Outbound = OutboundDNSTag routeRule.Outbound = OutboundMainProxyTag
} }
if routeRule.IsValid() { if routeRule.IsValid() {
@@ -647,6 +659,16 @@ func setRoutingOptions(options *option.Options, opt *ConfigOptions) {
Outbound: OutboundBlockTag, Outbound: OutboundBlockTag,
}, },
}) })
dnsRules = append(dnsRules, option.DefaultDNSRule{
RuleSet: []string{"geosite-ads",
"geosite-malware",
"geosite-phishing",
"geosite-cryptominers",
"geoip-malware",
"geoip-phishing"},
Server: DNSBlockTag,
// DisableCache: true,
})
} }
if opt.Region != "other" { if opt.Region != "other" {