Skip to content

Commit

Permalink
Revised sb routing, xray observatory.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Jan 21, 2025
1 parent e720c2d commit 001c4b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
22 changes: 2 additions & 20 deletions src/cores-configs/sing-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,7 @@ function buildSingBoxRoutingRules (proxySettings) {
const customBlockRulesTotal = customBlockRules ? customBlockRules.split(',') : [];
const defaultRules = [
{
type: "logical",
mode: "or",
rules: [
{
inbound: "dns-in",
},
{
network: "udp",
port: 53
}
],
protocol: "dns",
outbound: "dns-out"
},
{
Expand Down Expand Up @@ -762,14 +752,6 @@ const singboxConfigTemp = {
independent_cache: true
},
inbounds: [
{
type: "direct",
tag: "dns-in",
listen: "0.0.0.0",
listen_port: 6450,
override_address: "1.1.1.1",
override_port: 53
},
{
type: "tun",
tag: "tun-in",
Expand All @@ -788,7 +770,7 @@ const singboxConfigTemp = {
{
type: "mixed",
tag: "mixed-in",
listen: "0.0.0.0",
listen: "127.0.0.1",
listen_port: 2080,
sniff: true,
sniff_override_destination: false
Expand Down
12 changes: 8 additions & 4 deletions src/cores-configs/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ function buildXrayConfig (proxySettings, remark, isFragment, isBalancer, isChain

if (isBalancer) {
const interval = isWarp ? bestWarpInterval : bestVLTRInterval;
config.observatory.probeInterval = `${interval}s`;
config.observatory.pingConfig.interval = `${interval}s`;
if (balancerFallback) config.routing.balancers[0].fallbackTag = "prox-2";
if (isChain) {
config.observatory.subjectSelector.push("chain");
Expand Down Expand Up @@ -969,10 +969,14 @@ const xrayConfigTemp = {
]
},
observatory: {
probeInterval: "30s",
probeURL: "https://www.gstatic.com/generate_204",
subjectSelector: ["prox"],
EnableConcurrency: true,
pingConfig: {
destination: "https://connectivitycheck.gstatic.com/generate_204",
connectivity: "https://www.google.com/generate_204",
interval: "30s",
sampling: 1,
timeout: "10s"
}
},
stats: {}
};

0 comments on commit 001c4b0

Please sign in to comment.