From 001c4b007ab8e348c6cdbca588aa887c7b8a26b7 Mon Sep 17 00:00:00 2001 From: bia-pain-bache Date: Tue, 21 Jan 2025 21:37:11 +0330 Subject: [PATCH] Revised sb routing, xray observatory. --- src/cores-configs/sing-box.js | 22 ++-------------------- src/cores-configs/xray.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/cores-configs/sing-box.js b/src/cores-configs/sing-box.js index e7b256546..0e200a8db 100644 --- a/src/cores-configs/sing-box.js +++ b/src/cores-configs/sing-box.js @@ -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" }, { @@ -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", @@ -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 diff --git a/src/cores-configs/xray.js b/src/cores-configs/xray.js index da77135ea..5d05996ce 100644 --- a/src/cores-configs/xray.js +++ b/src/cores-configs/xray.js @@ -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"); @@ -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: {} }; \ No newline at end of file