luci-app-ssr-plus: sync upstream

last commit: 88e303de45
This commit is contained in:
gitea-action 2024-11-09 09:30:17 +08:00
parent 753ccac657
commit 90429028a6
6 changed files with 45 additions and 5 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=189
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY \

View File

@ -619,6 +619,7 @@ o:depends({type = "v2ray", v2ray_protocol = "socks"})
-- 传输协议
o = s:option(ListValue, "transport", translate("Transport"))
o:value("tcp", "TCP")
o:value("raw", "RAW")
o:value("kcp", "mKCP")
o:value("ws", "WebSocket")
o:value("httpupgrade", "HTTPUpgrade")
@ -642,14 +643,24 @@ o:value("none", translate("None"))
o:value("http", "HTTP")
o.rmempty = true
-- [[ RAW部分 ]]--
-- RAW伪装
o = s:option(ListValue, "raw_guise", translate("Camouflage Type"))
o:depends("transport", "raw")
o:value("none", translate("None"))
o:value("http", "HTTP")
o.rmempty = true
-- HTTP域名
o = s:option(Value, "http_host", translate("HTTP Host"))
o:depends("tcp_guise", "http")
o:depends("raw_guise", "http")
o.rmempty = true
-- HTTP路径
o = s:option(Value, "http_path", translate("HTTP Path"))
o:depends("tcp_guise", "http")
o:depends("raw_guise", "http")
o.rmempty = true
-- [[ WS部分 ]]--
@ -928,7 +939,9 @@ if is_finded("xray") then
end
o.rmempty = true
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", tls = true})
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "raw", tls = true})
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", reality = true})
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "raw", reality = true})
-- [[ uTLS ]]--
o = s:option(Value, "fingerprint", translate("Finger Print"))

View File

@ -314,7 +314,10 @@ function import_ssr_url(btn, urlname, sid) {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = url.hostname;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = url.port || "80";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vmess_id')[0].value = url.username;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = params.get("type") == "http" ? "h2" : params.get("type") || "tcp";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value =
params.get("type") == "http" ? "h2" :
(params.get("type") == "raw" ? "raw" :
(params.get("type") || "tcp"));
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event);
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vless_encryption')[0].value = params.get("encryption") || "none";
if ([ "tls", "xtls", "reality" ].includes(params.get("security"))) {
@ -375,6 +378,13 @@ function import_ssr_url(btn, urlname, sid) {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : "";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "";
}
case "raw":
document.getElementsByName('cbid.shadowsocksr.' + sid + '.raw_guise')[0].value = params.get("headerType") || "none";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.raw_guise')[0].dispatchEvent(event);
if (params.get("headerType") === "http") {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : "";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "";
}
break;
}
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";

View File

@ -231,6 +231,17 @@ end
}
}
} or nil,
rawSettings = (server.transport == "raw" and server.raw_guise == "http") and {
-- raw
header = {
type = server.raw_guise,
request = {
-- request
path = {server.http_path} or {"/"},
headers = {Host = {server.http_host} or {}}
}
}
} or nil,
kcpSettings = (server.transport == "kcp") and {
-- kcp
mtu = tonumber(server.mtu),

View File

@ -406,6 +406,12 @@ local function processData(szType, content)
result.tcp_host = params.host and UrlDecode(params.host) or nil
result.tcp_path = params.path and UrlDecode(params.path) or nil
end
elseif result.transport == "raw" then
result.raw_guise = params.headerType or "none"
if result.raw_guise == "http" then
result.tcp_host = params.host and UrlDecode(params.host) or nil
result.tcp_path = params.path and UrlDecode(params.path) or nil
end
end
end
if not result.alias then

View File

@ -1,5 +1,5 @@
diff --git a/luci-app-ssr-plus/Makefile b/luci-app-ssr-plus/Makefile
index 735b377..8c5387b 100644
index 04875d4..009827d 100644
--- a/luci-app-ssr-plus/Makefile
+++ b/luci-app-ssr-plus/Makefile
@@ -9,10 +9,9 @@ PKG_CONFIG_DEPENDS:= \
@ -338,7 +338,7 @@ index d0b77f1..259cb7f 100644
res();
});
diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
index 7603d8c..7f841fa 100644
index c81590e..18dcdf2 100644
--- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
+++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
@@ -69,9 +69,9 @@ function export_ssr_url(btn, urlname, sid) {
@ -416,7 +416,7 @@ index 7603d8c..7f841fa 100644
return false;
case "vless":
try {
@@ -377,10 +377,10 @@ function import_ssr_url(btn, urlname, sid) {
@@ -387,10 +387,10 @@ function import_ssr_url(btn, urlname, sid) {
}
break;
}