diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index 59f12fe2..2f8cade7 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -361,10 +361,12 @@ if singbox_tags:find("with_quic") then o.default = "30" o:depends({ [_n("protocol")] = "hysteria2", [_n("hysteria2_realms")] = false }) + o = s:option(Flag, _n("hysteria2_realms"), translate("Realms")) + o.default = "0" if api.compare_versions(singbox_version, ">=", "1.14.0") then - o = s:option(Flag, _n("hysteria2_realms"), translate("Realms")) - o.default = "0" o:depends({ [_n("protocol")] = "hysteria2"}) + else + o:depends({ [_n("protocol")] = "__hide"}) end o = s:option(Value, _n("hysteria2_realm_url"), translate("Realm URL"), translate("Example:") .. "realm://public@realm.hy2.io/your-realm-name") diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index 90b31ffa..a4e1cb6b 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -472,9 +472,10 @@ function get_valid_nodes() end end local port = e.port or e.hysteria_hop or e.hysteria2_hop - if (port and e.address) or e.hysteria2_realms then + local is_realm = (e.type == "Hysteria2" or e.protocol == 'hysteria2') and e.hysteria2_realms or nil + if (port and e.address) or is_realm then local address = e.address - if is_ip(address) or datatypes.hostname(address) or e.hysteria2_realms then + if is_ip(address) or datatypes.hostname(address) or is_realm then if (e.type == "sing-box" or e.type == "Xray") and e.protocol then local protocol = e.protocol if protocol == "vmess" then @@ -501,10 +502,11 @@ function get_valid_nodes() type_name = type_name .. " " .. protocol end if is_ipv6(address) then address = get_ipv6_full(address) end + type_name = is_realm and type_name .. " Realm" or type_name e["remark"] = trim("%s:[%s]" % {type_name, e.remarks}) if show_node_info == "1" then port = (port or ""):gsub(":", "-") - if not e.hysteria2_realms then + if not is_realm then e["remark"] = trim("%s:[%s] %s:%s" % {type_name, e.remarks, address, port}) end end @@ -596,6 +598,9 @@ function get_node_remarks(n) end type_name = type_name .. " " .. protocol end + if (n.type == "Hysteria2" or n.protocol == 'hysteria2') and n.hysteria2_realms then + type_name = type_name .. " Realm" + end remarks = trim("%s:[%s]" % {type_name, n.remarks}) end end diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index d385df68..f4530ae6 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -910,7 +910,11 @@ table td, .table .td { } else { port_s = o["hysteria_hop"] || o["hysteria2_hop"]; } - str += type + ":" + remarks; + if ((o.type === "Hysteria2" || o.protocol === 'hysteria2') && o.hysteria2_realms) { + str += type + " Realm:" + remarks; + } else { + str += type + ":" + remarks; + } return str; } @@ -962,7 +966,8 @@ table td, .table .td { } else { innerHTML = innerHTML.split("{{tcping}}").join('---'); } - if (o["protocol"] && o["protocol"] === '_shunt') { + let is_realm = (o.type === "Hysteria2" || o.protocol === 'hysteria2') && o.hysteria2_realms || false; + if (o["protocol"] === '_shunt' || is_realm) { innerHTML = innerHTML.split("{{url_test}}").join('---'); } else { innerHTML = innerHTML.split("{{url_test}}").join('<%:Test%>'); diff --git a/v2ray-core/Makefile b/v2ray-core/Makefile index 77ea13b4..f86a238c 100644 --- a/v2ray-core/Makefile +++ b/v2ray-core/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-core -PKG_VERSION:=5.49.0 +PKG_VERSION:=5.50.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=1a63c9179497db2d6bb7027eed5653d2b1dd3e9942b656146e87a7fd28f1d22b +PKG_HASH:=5a0bb169d07a62b1e9cc5a5b4adf1650a87ebcec2705b4c43626fb509937d634 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE