mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-14 04:15:06 +08:00
🌈 Sync 2026-05-19 02:35:14
This commit is contained in:
@@ -374,7 +374,7 @@ run_socks() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${error_msg}" ] && [ "$(config_n_get $node hysteria2_realms)" = "1" ]; then
|
||||
if [ -n "${error_msg}" ] && ([ -n "$(config_n_get $node hysteria_hop)" ] || [ -n "$(config_n_get $node hysteria2_hop)" ] || [ "$(config_n_get $node hysteria2_realms)" = "1" ]); then
|
||||
unset error_msg
|
||||
fi
|
||||
|
||||
@@ -463,17 +463,6 @@ run_socks() {
|
||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||
[ -n "$no_run" ] || ln_run "$(first_type ssr-local)" "ssr-local" $log_file -c "$config_file" -v -u
|
||||
;;
|
||||
ss)
|
||||
[ -n "$no_run" ] || {
|
||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
||||
json_add_string "plugin_sh" "$plugin_sh"
|
||||
}
|
||||
json_add_string "local_addr" "$bind"
|
||||
json_add_string "local_port" "$socks_port"
|
||||
json_add_string "mode" "tcp_and_udp"
|
||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||
[ -n "$no_run" ] || ln_run "$(first_type ss-local)" "ss-local" $log_file -c "$config_file" -v
|
||||
;;
|
||||
ss-rust)
|
||||
[ "$http_port" != "0" ] && {
|
||||
http_flag=1
|
||||
@@ -632,15 +621,6 @@ run_redir() {
|
||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||
ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v -U
|
||||
;;
|
||||
ss)
|
||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
||||
json_add_string "plugin_sh" "$plugin_sh"
|
||||
json_add_string "local_addr" "0.0.0.0"
|
||||
json_add_string "local_port" "$local_port"
|
||||
json_add_string "mode" "udp_only"
|
||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||
ln_run "$(first_type ss-redir)" "ss-redir" $log_file -c "$config_file" -v
|
||||
;;
|
||||
ss-rust)
|
||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
||||
json_add_string "plugin_sh" "$plugin_sh"
|
||||
@@ -889,23 +869,6 @@ run_redir() {
|
||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||
ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v ${_extra_param}
|
||||
;;
|
||||
ss)
|
||||
[ "${TCP_PROXY_WAY}" = "tproxy" ] && json_add_string "tcp_tproxy" "true"
|
||||
if [ "$TCP_UDP" = "1" ]; then
|
||||
config_file="${config_file//TCP/TCP_UDP}"
|
||||
UDP_REDIR_PORT=$TCP_REDIR_PORT
|
||||
unset UDP_NODE
|
||||
json_add_string "mode" "tcp_and_udp"
|
||||
else
|
||||
json_add_string "mode" "tcp_only"
|
||||
fi
|
||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
||||
json_add_string "plugin_sh" "$plugin_sh"
|
||||
json_add_string "local_addr" "0.0.0.0"
|
||||
json_add_string "local_port" "$local_port"
|
||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||
ln_run "$(first_type ss-redir)" "ss-redir" $log_file -c "$config_file" -v
|
||||
;;
|
||||
ss-rust)
|
||||
json_add_string "local_tcp_redir_port" "$local_port"
|
||||
[ "${TCP_PROXY_WAY}" = "tproxy" ] && json_add_string "tcp_tproxy" "true"
|
||||
@@ -2049,8 +2012,8 @@ get_config() {
|
||||
FILTER_PROXY_IPV6=$(config_t_get global filter_proxy_ipv6 0)
|
||||
DNS_REDIRECT=$(config_t_get global dns_redirect 1)
|
||||
|
||||
REDIRECT_LIST="socks ss ss-rust ssr sing-box xray naiveproxy hysteria2"
|
||||
TPROXY_LIST="socks ss ss-rust ssr sing-box xray hysteria2"
|
||||
REDIRECT_LIST="socks ss-rust ssr sing-box xray naiveproxy hysteria2"
|
||||
TPROXY_LIST="socks ss-rust ssr sing-box xray hysteria2"
|
||||
|
||||
NEXT_DNS_LISTEN_PORT=15353
|
||||
TUN_DNS="127.0.0.1#${NEXT_DNS_LISTEN_PORT}"
|
||||
|
||||
@@ -24,7 +24,6 @@ local UrlDecode = api.UrlDecode
|
||||
local uci = api.uci
|
||||
local fs = api.fs
|
||||
|
||||
local has_ss = api.is_finded("ss-redir")
|
||||
local has_ss_rust = api.is_finded("sslocal")
|
||||
local has_ssr = api.is_finded("ssr-local") and api.is_finded("ssr-redir")
|
||||
local has_singbox = api.finded_com("sing-box")
|
||||
@@ -35,7 +34,7 @@ local DEFAULT_FILTER_KEYWORD_MODE = uci:get(appname, "@global_subscribe[0]", "fi
|
||||
local DEFAULT_FILTER_KEYWORD_DISCARD_LIST = uci:get(appname, "@global_subscribe[0]", "filter_discard_list") or {}
|
||||
local DEFAULT_FILTER_KEYWORD_KEEP_LIST = uci:get(appname, "@global_subscribe[0]", "filter_keep_list") or {}
|
||||
-- 取节点使用core类型(节点订阅页面未设置时,自动取默认)
|
||||
local DEFAULT_SS_TYPE = api.get_core("ss_type", {{has_ss,"shadowsocks-libev"},{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local DEFAULT_SS_TYPE = api.get_core("ss_type", {{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local DEFAULT_TROJAN_TYPE = api.get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local DEFAULT_VMESS_TYPE = api.get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||
local DEFAULT_VLESS_TYPE = api.get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||
@@ -43,7 +42,6 @@ local DEFAULT_HYSTERIA2_TYPE = api.get_core("hysteria2_type", {{has_hysteria2,"h
|
||||
local core_has = {
|
||||
["xray"] = has_xray,
|
||||
["sing-box"] = has_singbox,
|
||||
["shadowsocks-libev"] = has_ss,
|
||||
["shadowsocks-rust"] = has_ss_rust,
|
||||
["hysteria2"] = has_hysteria2
|
||||
}
|
||||
@@ -482,9 +480,7 @@ end
|
||||
|
||||
-- 设置 ss 协议实现类型
|
||||
local function set_ss_implementation(ss_type, result)
|
||||
if ss_type == "shadowsocks-libev" and has_ss then
|
||||
result.type = "SS"
|
||||
elseif ss_type == "shadowsocks-rust" and has_ss_rust then
|
||||
if ss_type == "shadowsocks-rust" and has_ss_rust then
|
||||
result.type = 'SS-Rust'
|
||||
elseif ss_type == "xray" and has_xray then
|
||||
result.type = 'Xray'
|
||||
@@ -835,20 +831,6 @@ local function processData(szType, content, add_mode, group, sub_cfg)
|
||||
end
|
||||
end
|
||||
|
||||
if result.type == "SS" then
|
||||
local aead2022_methods = { "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" }
|
||||
local aead2022 = false
|
||||
for k, v in ipairs(aead2022_methods) do
|
||||
if method:lower() == v:lower() then
|
||||
aead2022 = true
|
||||
end
|
||||
end
|
||||
if aead2022 then
|
||||
-- shadowsocks-libev 不支持2022加密
|
||||
result.error_msg = "shadowsocks-libev 不支持2022加密。"
|
||||
end
|
||||
end
|
||||
|
||||
if params.type then
|
||||
params.type = string.lower(params.type)
|
||||
if result.type == "sing-box" and params.type == "raw" then
|
||||
@@ -862,7 +844,7 @@ local function processData(szType, content, add_mode, group, sub_cfg)
|
||||
else
|
||||
result.transport = params.type
|
||||
end
|
||||
if result.type ~= "SS-Rust" and result.type ~= "SS" then
|
||||
if result.type ~= "SS-Rust" then
|
||||
if params.type == 'ws' then
|
||||
result.ws_host = params.host
|
||||
result.ws_path = params.path
|
||||
|
||||
Reference in New Issue
Block a user