mirror of
https://github.com/kenzok8/small-package
synced 2025-01-09 08:59:26 +08:00
update 2024-08-04 14:13:40
This commit is contained in:
parent
1456c61171
commit
6515a015f4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user