Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Oct 17, 2024
2 parents c4ab572 + c4474df commit 8e02d90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
16 changes: 7 additions & 9 deletions _worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3375,7 +3375,7 @@ function buildXrayRoutingRules (proxySettings, outboundAddrs, isChain, isBalance
blockUDP443
} = proxySettings;

const isBypass = bypassIran || bypassChina || bypassRussia;
const isBypass = bypassIran || bypassChina || bypassRussia || bypassLAN;
const outboundDomains = outboundAddrs.filter(address => isDomain(address));
const isOutboundRule = outboundDomains.length > 0;
let rules = [
Expand Down Expand Up @@ -3404,7 +3404,7 @@ function buildXrayRoutingRules (proxySettings, outboundAddrs, isChain, isBalance
type: "field"
});

if (isBypass) {
if (isBypass && !isWorkerLess) {
let ipRule = {
ip: [],
outboundTag: "direct",
Expand All @@ -3417,13 +3417,11 @@ function buildXrayRoutingRules (proxySettings, outboundAddrs, isChain, isBalance
type: "field",
};

if (!isWorkerLess) {
bypassLAN && domainRule.domain.push("geosite:private") && ipRule.ip.push("geoip:private");
bypassIran && domainRule.domain.push("geosite:category-ir") && ipRule.ip.push("geoip:ir");
bypassChina && domainRule.domain.push("geosite:cn") && ipRule.ip.push("geoip:cn");
bypassRussia && domainRule.domain.push("geosite:category-ru") && ipRule.ip.push("geoip:ru");
rules.push(domainRule, ipRule);
}
bypassLAN && domainRule.domain.push("geosite:private") && ipRule.ip.push("geoip:private");
bypassIran && domainRule.domain.push("geosite:category-ir") && ipRule.ip.push("geoip:ir");
bypassChina && domainRule.domain.push("geosite:cn") && ipRule.ip.push("geoip:cn");
bypassRussia && domainRule.domain.push("geosite:category-ru") && ipRule.ip.push("geoip:ru");
rules.push(domainRule, ipRule);
}

blockUDP443 && rules.push({
Expand Down

0 comments on commit 8e02d90

Please sign in to comment.