update 2024-08-04 14:13:40

This commit is contained in:
kenzok8 2024-08-04 14:13:40 +08:00
parent 1456c61171
commit 6515a015f4

View File

@ -253,15 +253,18 @@ function connect_status()
e.use_time = ""
local url = luci.http.formvalue("url")
local baidu = string.find(url, "baidu")
local enabled = uci:get(appname, "@global[0]", "enabled")
local chn_list = uci:get(appname, "@global[0]", "chn_list")
local enabled = uci:get(appname, "@global[0]", "enabled") or "0"
local chn_list = uci:get(appname, "@global[0]", "chn_list") or "direct"
local gfw_list = uci:get(appname, "@global[0]", "use_gfw_list") or "1"
local proxy_mode = uci:get(appname, "@global[0]", "tcp_proxy_mode")
local socks_port = uci:get(appname, "@global[0]", "tcp_node_socks_port")
if enabled ~= 0 then
if (chn_list == "proxy" and gfw_list == 0 and proxy_mode ~= "proxy" and baidu ~= nil) or (chn_list == 0 and gfw_list == 0 and proxy_mode == "proxy") then
local proxy_mode = uci:get(appname, "@global[0]", "tcp_proxy_mode") or "proxy"
local socks_port = uci:get(appname, "@global[0]", "tcp_node_socks_port") or "1070"
local local_proxy = uci:get(appname, "@global[0]", "localhost_proxy") or "1"
if enabled == "1" and local_proxy == "0" then
if (chn_list == "proxy" and gfw_list == "0" and proxy_mode ~= "proxy" and baidu ~= nil) or (chn_list == "0" and gfw_list == "0" and proxy_mode == "proxy") then
-- 中国列表+百度 or 全局
url = "-x socks5h://127.0.0.1:" .. socks_port .. " " .. url
elseif baidu == nil then
-- 其他代理模式+百度以外网站
url = "-x socks5h://127.0.0.1:" .. socks_port .. " " .. url
end
end