parent
5e2b7dc51a
commit
1bf1c8bae2
@ -927,6 +927,7 @@ if is_finded("xray") then
|
||||
o:value(v, translate(v))
|
||||
end
|
||||
o.rmempty = true
|
||||
o:depends("xtls", true)
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", tls = true})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", reality = true})
|
||||
|
||||
@ -951,6 +952,7 @@ end
|
||||
o = s:option(Value, "tls_host", translate("TLS Host"))
|
||||
o.datatype = "hostname"
|
||||
o:depends("tls", true)
|
||||
o:depends("xtls", true)
|
||||
o:depends("reality", true)
|
||||
o.rmempty = true
|
||||
|
||||
|
@ -269,6 +269,14 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "httpupgrade") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.httpupgrade_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.httpupgrade_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "splithttp") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.splithttp_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.splithttp_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "h2") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_path')[0].value = ssm.path;
|
||||
@ -309,19 +317,21 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = params.get("type") == "http" ? "h2" : 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", "reality" ].includes(params.get("security"))) {
|
||||
if ([ "tls", "xtls", "reality" ].includes(params.get("security"))) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.' + params.get("security"))[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.' + params.get("security"))[0].dispatchEvent(event);
|
||||
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.fingerprint')[0].value = params.get("fp") || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_flow')[0].value = params.get("flow") || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = params.get("sni") || "";
|
||||
|
||||
if (params.get("security") === "reality") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.reality_publickey')[0].value = params.get("pbk") ? decodeURIComponent(params.get("pbk")) : "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.reality_shortid')[0].value = params.get("sid") || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.reality_spiderx')[0].value = params.get("spx") ? decodeURIComponent(params.get("spx")) : "";
|
||||
}
|
||||
if (params.get("security") === "xtls") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_flow')[0].value = params.get("flow") || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_flow')[0].dispatchEvent(event);
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.fingerprint')[0].value = params.get("fp") || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = params.get("sni") || "";
|
||||
}
|
||||
switch (params.get("type")) {
|
||||
case "ws":
|
||||
@ -329,6 +339,16 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "/";
|
||||
break;
|
||||
case "httpupgrade":
|
||||
if (params.get("security") !== "tls")
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.httpupgrade_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.httpupgrade_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "/";
|
||||
break;
|
||||
case "splithttp":
|
||||
if (params.get("security") !== "tls")
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.splithttp_host')[0].value = params.get("host") ? decodeURIComponent(params.get("host")) : "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.splithttp_path')[0].value = params.get("path") ? decodeURIComponent(params.get("path")) : "/";
|
||||
break;
|
||||
case "kcp":
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.kcp_guise')[0].value = params.get("headerType") || "none";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.seed')[0].value = params.get("seed") || "";
|
||||
|
@ -26,7 +26,7 @@ function vmess_vless()
|
||||
alterId = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and tonumber(server.alter_id) or nil,
|
||||
security = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and server.security or nil,
|
||||
encryption = (server.v2ray_protocol == "vless") and server.vless_encryption or nil,
|
||||
flow = ((server.tls == '1') or (server.reality == '1')) and server.tls_flow or nil
|
||||
flow = ((server.xtls == '1') or (server.tls == '1') or (server.reality == '1')) and server.tls_flow or nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -178,8 +178,8 @@ local Xray = {
|
||||
-- 底层传输配置
|
||||
streamSettings = (server.v2ray_protocol ~= "wireguard") and {
|
||||
network = server.transport or "tcp",
|
||||
security = (server.tls == '1') and "tls" or (server.reality == '1') and "reality" or nil,
|
||||
tlsSettings = (server.tls == '1') and {
|
||||
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 {
|
||||
-- tls
|
||||
alpn = server.tls_alpn,
|
||||
fingerprint = server.fingerprint,
|
||||
@ -190,6 +190,12 @@ local Xray = {
|
||||
certificateFile = server.certpath
|
||||
} or nil,
|
||||
} or nil,
|
||||
xtlsSettings = (server.xtls == '1') and server.tls_host and {
|
||||
-- xtls
|
||||
allowInsecure = (server.insecure == "1") and true or nil,
|
||||
serverName = server.tls_host,
|
||||
minVersion = "1.3"
|
||||
} or nil,
|
||||
realitySettings = (server.reality == '1') and {
|
||||
publicKey = server.reality_publickey,
|
||||
shortId = server.reality_shortid,
|
||||
|
@ -182,6 +182,14 @@ local function processData(szType, content)
|
||||
result.ws_host = info.host
|
||||
result.ws_path = info.path
|
||||
end
|
||||
if info.net == 'httpupgrade' then
|
||||
result.httpupgrade_host = info.host
|
||||
result.httpupgrade_path = info.path
|
||||
end
|
||||
if info.net == 'splithttp' then
|
||||
result.splithttp_host = info.host
|
||||
result.splithttp_path = info.path
|
||||
end
|
||||
if info.net == 'h2' then
|
||||
result.h2_host = info.host
|
||||
result.h2_path = info.path
|
||||
@ -354,9 +362,10 @@ local function processData(szType, content)
|
||||
result.vmess_id = url.user
|
||||
result.vless_encryption = params.encryption or "none"
|
||||
result.transport = params.type or "tcp"
|
||||
result.tls = (params.security == "tls" or params.security == "xtls") and "1" or "0"
|
||||
result.tls = (params.security == "tls") and "1" or "0"
|
||||
result.tls_host = params.sni
|
||||
result.tls_flow = (params.security == "tls" or params.security == "reality") and params.flow or nil
|
||||
result.xtls = (params.security == "xtls") and "1" or nil
|
||||
result.tls_flow = (result.tls == "1" or result.xtls == "1" or result.reality == "1") and params.flow or nil
|
||||
result.fingerprint = params.fp
|
||||
result.reality = (params.security == "reality") and "1" or "0"
|
||||
result.reality_publickey = params.pbk and UrlDecode(params.pbk) or nil
|
||||
@ -365,6 +374,12 @@ local function processData(szType, content)
|
||||
if result.transport == "ws" then
|
||||
result.ws_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
||||
result.ws_path = params.path and UrlDecode(params.path) or "/"
|
||||
elseif result.transport == "httpupgrade" then
|
||||
result.httpupgrade_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
||||
result.httpupgrade_path = params.path and UrlDecode(params.path) or "/"
|
||||
elseif result.transport == "splithttp" then
|
||||
result.splithttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
||||
result.splithttp_path = params.path and UrlDecode(params.path) or "/"
|
||||
-- make it compatible with bullshit, "h2" transport is non-existent at all
|
||||
elseif result.transport == "http" or result.transport == "h2" then
|
||||
result.transport = "h2"
|
||||
|
@ -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 479d7e2..5eecbee 100644
|
||||
index 7603d8c..7f841fa 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) {
|
||||
@ -407,7 +407,7 @@ index 479d7e2..5eecbee 100644
|
||||
return false;
|
||||
case "vmess":
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
@@ -287,7 +287,7 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
@@ -295,7 +295,7 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event);
|
||||
@ -416,7 +416,7 @@ index 479d7e2..5eecbee 100644
|
||||
return false;
|
||||
case "vless":
|
||||
try {
|
||||
@@ -357,10 +357,10 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
@@ -377,10 +377,10 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user