diff --git a/_worker.js b/_worker.js index 2bf4ecef5..fd2d99990 100644 --- a/_worker.js +++ b/_worker.js @@ -5989,10 +5989,10 @@ function renderHomePage(proxySettings, hostName, isPassSet) { - - @@ -6090,10 +6090,10 @@ function renderHomePage(proxySettings, hostName, isPassSet) { - - @@ -7056,7 +7056,7 @@ async function buildXrayDNS(proxySettings, outboundAddrs, domainToStaticIPs, isW if (blockPorn) { dnsObject.hosts["geosite:category-porn"] = ["127.0.0.1"]; } - !isWorkerLess && isOutboundRule && !domainToStaticIPs && dnsObject.servers.push({ + !isWorkerLess && isOutboundRule && dnsObject.servers.push({ address: localDNS === "localhost" ? "8.8.8.8" : localDNS, domains: outboundRules }); @@ -7086,9 +7086,9 @@ async function buildXrayDNS(proxySettings, outboundAddrs, domainToStaticIPs, isW } return dnsObject; } -function buildXrayRoutingRules(proxySettings, outboundAddrs, isChain, isBalancer, isWorkerLess, isWarp) { +function buildXrayRoutingRules(proxySettings, outboundAddrs, isChain, isBalancer, isWorkerLess) { const { localDNS, bypassLAN, bypassIran, bypassChina, bypassRussia, blockAds, blockPorn, blockUDP443 } = proxySettings; - const isBypass = bypassIran || bypassLAN || bypassChina || bypassRussia; + const isBypass = bypassIran || bypassChina || bypassRussia; const outboundDomains = outboundAddrs.filter((address) => isDomain(address)); const isOutboundRule = outboundDomains.length > 0; let rules = [ @@ -7145,7 +7145,7 @@ function buildXrayRoutingRules(proxySettings, outboundAddrs, isChain, isBalancer blockPorn && rule.domain.push("geosite:category-porn"); rules.push(rule); } - blockUDP443 && isWarp && !isWorkerLess && rules.push({ + blockUDP443 && rules.push({ network: "udp", port: "443", outboundTag: "block", @@ -7493,7 +7493,7 @@ async function buildXrayBestFragmentConfig(proxySettings, hostName, chainProxy, "100-200" ]; let config = buildXrayConfig(proxySettings, "\u{1F4A6} BPB F - Best Fragment \u{1F60E}", true, true, chainProxy, void 0, false); - config.dns = await buildXrayDNS(proxySettings, [hostName], hostName); + config.dns = await buildXrayDNS(proxySettings, [], hostName); config.routing.rules = buildXrayRoutingRules(proxySettings, [], chainProxy, true, false, false); const fragment = config.outbounds.shift(); let bestFragOutbounds = []; @@ -7696,8 +7696,7 @@ function buildClashRoutingRules(proxySettings, isWarp) { bypassIran && rules.push("GEOIP,ir,DIRECT,no-resolve"); bypassChina && rules.push("GEOIP,cn,DIRECT,no-resolve"); bypassRussia && rules.push("GEOIP,ru,DIRECT,no-resolve"); - blockUDP443 && isWarp && rules.push("AND,((NETWORK,udp),(DST-PORT,443)),REJECT"); - !isWarp && rules.push("NETWORK,udp,REJECT"); + blockUDP443 && rules.push("AND,((NETWORK,udp),(DST-PORT,443)),REJECT"); blockAds && rules.push("GEOSITE,category-ads-all,REJECT", "GEOSITE,category-ads-ir,REJECT"); blockPorn && rules.push("GEOSITE,category-porn,REJECT"); rules.push("MATCH,\u2705 Selector"); @@ -8168,11 +8167,7 @@ function buildSingBoxRoutingRules(proxySettings, isWarp) { ip_is_private: true, outbound: "direct" }); - !isWarp && rules.push({ - network: "udp", - outbound: "block" - }); - blockUDP443 && isWarp && rules.push({ + blockUDP443 && rules.push({ network: "udp", port: 443, protocol: "quic", diff --git a/src/worker.js b/src/worker.js index 60d41d462..503297c99 100644 --- a/src/worker.js +++ b/src/worker.js @@ -2229,10 +2229,10 @@ function renderHomePage (proxySettings, hostName, isPassSet) { - - @@ -2330,10 +2330,10 @@ function renderHomePage (proxySettings, hostName, isPassSet) { - - @@ -3338,7 +3338,7 @@ async function buildXrayDNS (proxySettings, outboundAddrs, domainToStaticIPs, is dnsObject.hosts["geosite:category-porn"] = ["127.0.0.1"]; } - !isWorkerLess && isOutboundRule && !domainToStaticIPs && dnsObject.servers.push({ + !isWorkerLess && isOutboundRule && dnsObject.servers.push({ address: localDNS === 'localhost' ? '8.8.8.8' : localDNS, domains: outboundRules }); @@ -3373,9 +3373,9 @@ async function buildXrayDNS (proxySettings, outboundAddrs, domainToStaticIPs, is return dnsObject; } -function buildXrayRoutingRules (proxySettings, outboundAddrs, isChain, isBalancer, isWorkerLess, isWarp) { +function buildXrayRoutingRules (proxySettings, outboundAddrs, isChain, isBalancer, isWorkerLess) { const { localDNS, bypassLAN, bypassIran, bypassChina, bypassRussia, blockAds, blockPorn, blockUDP443 } = proxySettings; - const isBypass = bypassIran || bypassLAN || bypassChina || bypassRussia; + const isBypass = bypassIran || bypassChina || bypassRussia; const outboundDomains = outboundAddrs.filter(address => isDomain(address)); const isOutboundRule = outboundDomains.length > 0; let rules = [ @@ -3438,7 +3438,7 @@ function buildXrayRoutingRules (proxySettings, outboundAddrs, isChain, isBalance rules.push(rule); } - blockUDP443 && isWarp && !isWorkerLess && rules.push({ + blockUDP443 && rules.push({ network: "udp", port: "443", outboundTag: "block", @@ -3797,7 +3797,7 @@ async function buildXrayBestFragmentConfig(proxySettings, hostName, chainProxy, '40-60', '50-70', '60-80', '70-90', '80-100', '100-200']; let config = buildXrayConfig(proxySettings, '💦 BPB F - Best Fragment 😎', true, true, chainProxy, undefined, false); - config.dns = await buildXrayDNS(proxySettings, [hostName], hostName); + config.dns = await buildXrayDNS(proxySettings, [], hostName); config.routing.rules = buildXrayRoutingRules(proxySettings, [], chainProxy, true, false, false); const fragment = config.outbounds.shift(); let bestFragOutbounds = []; @@ -4031,8 +4031,7 @@ function buildClashRoutingRules (proxySettings, isWarp) { bypassIran && rules.push('GEOIP,ir,DIRECT,no-resolve'); bypassChina && rules.push('GEOIP,cn,DIRECT,no-resolve'); bypassRussia && rules.push('GEOIP,ru,DIRECT,no-resolve'); - blockUDP443 && isWarp && rules.push('AND,((NETWORK,udp),(DST-PORT,443)),REJECT'); - !isWarp && rules.push('NETWORK,udp,REJECT'); + blockUDP443 && rules.push('AND,((NETWORK,udp),(DST-PORT,443)),REJECT'); blockAds && rules.push('GEOSITE,category-ads-all,REJECT', 'GEOSITE,category-ads-ir,REJECT'); blockPorn && rules.push('GEOSITE,category-porn,REJECT'); rules.push('MATCH,✅ Selector'); @@ -4541,13 +4540,8 @@ function buildSingBoxRoutingRules (proxySettings, isWarp) { ip_is_private: true, outbound: "direct" }); - - !isWarp && rules.push({ - network: "udp", - outbound: "block" - }); - blockUDP443 && isWarp && rules.push({ + blockUDP443 && rules.push({ network: "udp", port: 443, protocol: "quic",