diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua index cec60a343..dfc39586d 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua @@ -362,7 +362,7 @@ o.default = 0 o:depends({ [_n("fallback")] = true }) ]]-- -o = s:option(DynamicList, _n("fallback_list"), "Fallback", translate("dest,path")) +o = s:option(DynamicList, _n("fallback_list"), "Fallback", translate("format: dest,path,xver")) o:depends({ [_n("fallback")] = true }) o = s:option(Flag, _n("bind_local"), translate("Bind Local"), translate("When selected, it can only be accessed localhost.")) diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 44baa84d0..2b7897427 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -371,19 +371,19 @@ function gen_config_server(node) local fallbackStr = node.fallback_list[i] if fallbackStr then local tmp = {} - string.gsub(fallbackStr, '[^' .. "," .. ']+', function(w) + string.gsub(fallbackStr, '[^,]+', function(w) table.insert(tmp, w) end) local dest = tmp[1] or "" local path = tmp[2] - if dest:find("%.") then - else + local xver = tonumber(tmp[3]) + if not dest:find("%.") then dest = tonumber(dest) end fallbacks[i] = { path = path, dest = dest, - xver = 1 + xver = xver } end end