% local uci=require"luci.model.uci".cursor() local json=require"luci.jsonc" local function valid_port(value, default) value = tostring(value or default) if value:match("^%d+$") then local port = tonumber(value) if port and port >= 1 and port <= 65535 then return tostring(port) end end return default end local isonlyoneprot = uci:get("gecoosac", "config", "isonlyoneprot") or "1" local https = uci:get("gecoosac", "config", "https") or "0" local port = valid_port(uci:get("gecoosac", "config", "port"), "60650") local m_port = valid_port(uci:get("gecoosac", "config", "m_port"), "8080") local http = "http://" if isonlyoneprot == "0" then port = m_port if https == "1" then http = "https://" end end -%>