Skip to content

Commit

Permalink
luci-app-ssr-plus: Fix vmess's RAW transport protocol configuration…
Browse files Browse the repository at this point in the history
… and subscribe.
  • Loading branch information
zxlhhyccc committed Dec 17, 2024
1 parent 84dd876 commit caef0f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = ssm.port;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alter_id')[0].value = ssm.aid;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vmess_id')[0].value = ssm.id;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = ssm.net;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value =
(ssm.net === "raw" || ssm.net === "tcp") ? "raw" : ssm.net;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event);
if (ssm.net == "tcp") {
if (ssm.net === "raw" || ssm.net === "tcp") {
if (ssm.type && ssm.type != "http") {
ssm.type = "none"
ssm.type = "none";
} else {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_host')[0].value = ssm.host;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_path')[0].value = ssm.path;
Expand Down Expand Up @@ -294,8 +295,10 @@
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event);
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = ssm.sni || ssm.host;
}
if (ssm.mux !== undefined) {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event);
}
s.innerHTML = "<font style=\'color:green\'><%:Import configuration information successfully.%></font>";
return false;
case "vless":
Expand Down
5 changes: 4 additions & 1 deletion luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ local function processData(szType, content)
result.v2ray_protocol = 'vmess'
result.server = info.add
result.server_port = info.port
if info.net == "tcp" then
info.net = "raw"
end
result.transport = info.net
result.alter_id = info.aid
result.vmess_id = info.id
Expand All @@ -194,7 +197,7 @@ local function processData(szType, content)
result.h2_host = info.host
result.h2_path = info.path
end
if info.net == 'tcp' then
if info.net == 'raw' or info.net == 'tcp' then
if info.type and info.type ~= "http" then
info.type = "none"
end
Expand Down

0 comments on commit caef0f0

Please sign in to comment.