From 89d9efc72866c2d9ff75008aeba95b333f98a8a8 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Fri, 30 Aug 2024 00:22:53 +0800 Subject: [PATCH] update 2024-08-30 00:22:53 --- .../luasrc/model/cbi/passwall/client/socks_config.lua | 6 ++++++ luci-app-passwall/root/usr/share/passwall/test.sh | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua index 62d7495e3..c537d5519 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua @@ -112,6 +112,12 @@ o:depends("enable_autoswitch", true) o = s:option(Value, "autoswitch_probe_url", translate("Probe URL"), translate("The URL used to detect the connection status.")) o.default = "https://www.google.com/generate_204" +o:value("https://cp.cloudflare.com/", "Cloudflare") +o:value("https://www.gstatic.com/generate_204", "Gstatic") +o:value("https://www.google.com/generate_204", "Google") +o:value("https://www.youtube.com/generate_204", "YouTube") +o:value("https://connect.rom.miui.com/generate_204", "MIUI (CN)") +o:value("https://connectivitycheck.platform.hicloud.com/generate_204", "HiCloud (CN)") o:depends("enable_autoswitch", true) for k, v in pairs(nodes_table) do diff --git a/luci-app-passwall/root/usr/share/passwall/test.sh b/luci-app-passwall/root/usr/share/passwall/test.sh index db67207be..7752a2650 100755 --- a/luci-app-passwall/root/usr/share/passwall/test.sh +++ b/luci-app-passwall/root/usr/share/passwall/test.sh @@ -73,7 +73,10 @@ url_test_node() { local curlx="socks5h://127.0.0.1:${_tmp_port}" fi sleep 1s - result=$(curl --connect-timeout 3 -o /dev/null -I -skL -w "%{http_code}:%{time_starttransfer}" -x $curlx "https://www.google.com/generate_204") + local chn_list=$(config_n_get @global[0] chn_list direct) + local probeUrl="https://www.google.com/generate_204" + [ "${chn_list}" = "proxy" ] && probeUrl="https://www.baidu.com" + result=$(curl --connect-timeout 3 -o /dev/null -I -skL -w "%{http_code}:%{time_appconnect}" -x $curlx "${probeUrl}") pgrep -af "url_test_${node_id}" | awk '! /test\.sh/{print $1}' | xargs kill -9 >/dev/null 2>&1 rm -rf "/tmp/etc/${CONFIG}/url_test_${node_id}.json" }