update 2026-10-21 17:03:19

This commit is contained in:
action committed 2026-10-21 17:03:19 +08:00
1 parent 4570f1512e
commit a9612da342
14 files changed
+182 -21

No files matched your search

@@ -992,6 +992,8 @@ use_mihomo_for_ss_rust_server() {
}
start_v2ray_with_mihomo() {
[ "$(uci_get_by_name "$1" transport)" = "kcptun" ] && return 1
[ "$(uci_get_by_name "$1" xray_shadowtls 0)" = "1" ] && return 1
# These nodes use Xray-specific settings.
case "$(uci_get_by_name "$1" v2ray_protocol)" in naive|shadowsocksr|tuic) return 1 ;; esac
local sid="$1"
@@ -2247,6 +2249,10 @@ get_udp_relay_mode() {
;;
v2ray)
proto=$(uci_get_by_name "$node" v2ray_protocol)
if [ "$(uci_get_by_name "$node" transport)" = "kcptun" ]; then
case "$proto" in vmess|vless|trojan) echo "native" ;; *) echo "disabled" ;; esac
return
fi
case "$proto" in
snell)
case "$(uci_get_by_name "$node" snell_version 4)" in 1|2) echo "disabled" ;; *) echo "native" ;; esac
@@ -2749,6 +2755,16 @@ start_server() {
echolog "Server: Xray NaiveProxy Server$server_count Started!"
;;
ssr-xray)
xray_bin="$(first_type xray)"
[ -x "$xray_bin" ] || return 1
config_file="$TMP_PATH/xray-server-$server_count.json"
lua /usr/share/shadowsocksr/gen_ssr_server.lua "$1" > "$config_file" || return 1
"$xray_bin" run -test -c "$config_file" >> /var/ssrplus.log 2>&1 || return 1
ln_start_bin "$xray_bin" xray-server-$server_count run -c "$config_file"
echolog "Server: Xray ShadowsocksR Server$server_count Started!"
;;
anytls)
xray_bin="$(first_type xray)"
[ -x "$xray_bin" ] || return 1
@@ -935,6 +935,45 @@ if server.v2ray_protocol == "naive" or server.v2ray_protocol == "shadowsocksr" o
ob.mux = nil
end
if server.type == "v2ray" and server.transport == "kcptun" then
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true, socks = true, http = true}
assert(supported[server.v2ray_protocol], "Kcptun requires a supported stream proxy protocol")
assert(server.tls ~= "1" and server.reality ~= "1" and server.xtls ~= "1", "Kcptun cannot be combined with stream TLS or REALITY")
assert(server.kcp_enable ~= "1", "Native Kcptun cannot be combined with the external Kcptun client")
assert(not server.tls_flow or server.tls_flow == "", "Kcptun cannot be combined with XTLS flow")
local options = {}
if server.xray_kcptun_options and server.xray_kcptun_options:match("%S") then
assert(server.xray_kcptun_options:match("^%s*{"), "Kcptun options must be a JSON object")
options = json.parse(server.xray_kcptun_options)
assert(type(options) == "table", "Kcptun options must be a JSON object")
end
options.key = server.xray_kcptun_key
options.crypt = server.xray_kcptun_crypt or "aes"
options.mode = server.xray_kcptun_mode or "fast"
options.smuxver = tonumber(server.xray_kcptun_smuxver) or 1
options.nocomp = server.xray_kcptun_nocomp == "1"
options.conn = tonumber(server.xray_kcptun_conn) or 1
Xray.outbounds[1].streamSettings.kcptunSettings = options
end
if server.type == "v2ray" and server.xray_shadowtls == "1" then
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true}
assert(supported[server.v2ray_protocol], "ShadowTLS requires a supported TCP proxy protocol")
assert((server.transport or "raw") == "raw" or server.transport == "tcp", "ShadowTLS requires RAW/TCP")
assert(server.tls ~= "1" and server.reality ~= "1", "ShadowTLS cannot be combined with TLS or REALITY")
assert(not server.tls_flow or server.tls_flow == "", "ShadowTLS cannot be combined with XTLS flow")
local stream = Xray.outbounds[1].streamSettings
stream.security = "shadowtls"
stream.shadowtlsSettings = {
version = tonumber(server.xray_shadowtls_version) or 3,
password = server.xray_shadowtls_password,
serverName = server.xray_shadowtls_sni,
fingerprint = server.xray_shadowtls_fingerprint or "chrome",
strictMode = server.xray_shadowtls_strict ~= "0",
allowInsecure = server.xray_shadowtls_insecure == "1"
}
end
if xray_builtin_dns then
table.insert(Xray.outbounds, {
protocol = "dns",
@@ -0,0 +1,13 @@
#!/usr/bin/lua
local uci = require("luci.model.uci").cursor()
local json = require "luci.jsonc"
local s = assert(uci:get_all("shadowsocksr", arg[1]), "missing server section")
print(json.stringify({
log = {loglevel = "warning"},
inbounds = {{listen = "::", port = assert(tonumber(s.server_port)), protocol = "shadowsocksr",
settings = {password = assert(s.password), method = s.ssr_method or "aes-128-cfb",
protocol = s.ssr_protocol or "auth_aes128_sha1", protocolParam = s.ssr_protocol_param or "",
obfs = s.ssr_obfs or "plain", obfsParam = s.ssr_obfs_param or "", network = "tcp,udp"}
}},
outbounds = {{protocol = "freedom", settings = {}}}
}, 1))