Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-ssr-plus: Fix link failure for latest Xray version. #1559

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion luci-app-ssr-plus/root/etc/init.d/shadowsocksr
Original file line number Diff line number Diff line change
Expand Up @@ -745,14 +745,19 @@ Start_Run() {
echolog "Main node:$(get_name $type) $threads Threads Started!"
;;
v2ray)
local version=$($(first_type xray v2ray) version | head -1 | awk '{print $2}')
local xray_protocol=$(uci_get_by_name $GLOBAL_SERVER v2ray_protocol)
gen_config_file $GLOBAL_SERVER $type 1 $tcp_port $socks_port
ln_start_bin $(first_type xray v2ray) v2ray run -config $tcp_config_file
if [ "$xray_protocol" = "vless" ] && [ "$(echo -e "$version\n1.18.24" | sort -V)" ]; then
ARG_UDP=""
fi
echolog "Main node:$($(first_type xray v2ray) version | head -1) Started!"
;;
trojan)
gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
for i in $(seq 1 $threads); do
ln_start_bin $(first_type $type) $type --config $tcp_config_file
ln_start_bin $(first_type $type) $type --config $tcp_config_file
done
echolog "Main node:$($(first_type $type) --version 2>&1 | head -1) , $threads Threads Started!"
;;
Expand Down
96 changes: 50 additions & 46 deletions luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,61 +125,63 @@ local Xray = {
loglevel = "warning"
},
-- 传入连接
inbound = (local_port ~= "0") and {
-- listening
port = tonumber(local_port),
protocol = "dokodemo-door",
settings = {network = proto, followRedirect = true},
sniffing = {
enabled = true,
destOverride = {"http", "tls", "quic"},
domainsExcluded = {
"courier.push.apple.com",
"rbsxbxp-mim.vivox.com",
"rbsxbxp.www.vivox.com",
"rbsxbxp-ws.vivox.com",
"rbspsxp.www.vivox.com",
"rbspsxp-mim.vivox.com",
"rbspsxp-ws.vivox.com",
"rbswxp.www.vivox.com",
"rbswxp-mim.vivox.com",
"disp-rbspsp-5-1.vivox.com",
"disp-rbsxbp-5-1.vivox.com",
"proxy.rbsxbp.vivox.com",
"proxy.rbspsp.vivox.com",
"proxy.rbswp.vivox.com",
"rbswp.vivox.com",
"rbsxbp.vivox.com",
"rbspsp.vivox.com",
"rbspsp.www.vivox.com",
"rbswp.www.vivox.com",
"rbsxbp.www.vivox.com",
"rbsxbxp.vivox.com",
"rbspsxp.vivox.com",
"rbswxp.vivox.com",
"Mijia Cloud",
"dlg.io.mi.com"
}
}
} or nil,
inbounds = (local_port ~= "0") and {
-- 开启 socks 代理
inboundDetour = (proto:find("tcp") and socks_port ~= "0") and {
{
-- socks
protocol = "socks",
port = tonumber(socks_port),
port = (proto:find("tcp") and socks_port ~= "0") and tonumber(socks_port),
settings = {auth = "noauth", udp = true}
}
} or nil,
} or nil,
{
-- listening
port = tonumber(local_port),
protocol = "dokodemo-door",
settings = {network = proto, followRedirect = true},
metadataOnly = false,
sniffing = {
enabled = true,
destOverride = {"http", "tls", "quic"},
domainsExcluded = {
"courier.push.apple.com",
"rbsxbxp-mim.vivox.com",
"rbsxbxp.www.vivox.com",
"rbsxbxp-ws.vivox.com",
"rbspsxp.www.vivox.com",
"rbspsxp-mim.vivox.com",
"rbspsxp-ws.vivox.com",
"rbswxp.www.vivox.com",
"rbswxp-mim.vivox.com",
"disp-rbspsp-5-1.vivox.com",
"disp-rbsxbp-5-1.vivox.com",
"proxy.rbsxbp.vivox.com",
"proxy.rbspsp.vivox.com",
"proxy.rbswp.vivox.com",
"rbswp.vivox.com",
"rbsxbp.vivox.com",
"rbspsp.vivox.com",
"rbspsp.www.vivox.com",
"rbswp.www.vivox.com",
"rbsxbp.www.vivox.com",
"rbsxbxp.vivox.com",
"rbspsxp.vivox.com",
"rbswxp.vivox.com",
"Mijia Cloud",
"dlg.io.mi.com"
}
}
} or nil,
},
-- 传出连接
outbound = {
outbounds = {
{
protocol = server.v2ray_protocol,
settings = outbound_settings,
-- 底层传输配置
streamSettings = (server.v2ray_protocol ~= "wireguard") and {
network = server.transport or "tcp",
security = (server.xtls == '1') and "xtls" or (server.tls == '1') and "tls" or (server.reality == '1') and "reality" or nil,
tlsSettings = (server.tls == '1') and (server.tls_host or server.fingerprint) and {
tlsSettings = (server.tls == '1') and {
-- tls
alpn = server.tls_alpn,
fingerprint = server.fingerprint,
Expand Down Expand Up @@ -269,6 +271,7 @@ local Xray = {
initial_windows_size = tonumber(server.initial_windows_size) or nil
} or nil,
sockopt = {
mark = 255,
tcpMptcp = (server.mptcp == "1") and true or false, -- MPTCP
tcpNoDelay = (server.mptcp == "1") and true or false, -- MPTCP
tcpcongestion = server.custom_tcpcongestion -- 连接服务器节点的 TCP 拥塞控制算法
Expand All @@ -280,7 +283,8 @@ local Xray = {
concurrency = tonumber(server.concurrency), -- TCP 最大并发连接数
xudpConcurrency = tonumber(server.xudpConcurrency), -- UDP 最大并发连接数
xudpProxyUDP443 = server.xudpProxyUDP443 -- 对被代理的 UDP/443 流量处理方式
} or nil
} or nil,
}
}
}
local cipher = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA"
Expand Down Expand Up @@ -351,7 +355,7 @@ local hysteria = {
hopInterval = (server.port_range and (tonumber(server.hopinterval) .. "s") or nil)
} or nil)
} or nil,
--[[
--[[
tcpTProxy = (proto:find("tcp") and local_port ~= "0") and {
listen = "0.0.0.0:" .. tonumber(local_port)
} or nil,
Expand Down Expand Up @@ -488,7 +492,7 @@ local tuic = {
},
["local"] = {
server = tonumber(socks_port) and "[::]:" .. (socks_port == "0" and local_port or tonumber(socks_port)),
dual_stack = (server.tuic_dual_stack == "1") and true or nil,
dual_stack = (server.tuic_dual_stack == "1") and true or nil,
max_packet_size = tonumber(server.tuic_max_package_size)
}
}
Expand Down
Loading