mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 06:07:37 +03:00
mod_httpserver: Allow configuration of ports and base path, like mod_bosh
This commit is contained in:
parent
23116a45d4
commit
3d891979ef
1 changed files with 12 additions and 1 deletions
|
@ -19,4 +19,15 @@ local function handle_request(method, body, request)
|
|||
return data;
|
||||
end
|
||||
|
||||
httpserver.new{ port = 5280, base = "files", handler = handle_request, ssl = false}
|
||||
local ports = config.get(module.host, "core", "http_ports") or { 5280 };
|
||||
for _, options in ipairs(ports) do
|
||||
local port, base, ssl, interface = 5280, "files", false, nil;
|
||||
if type(options) == "number" then
|
||||
port = options;
|
||||
elseif type(options) == "table" then
|
||||
port, base, ssl, interface = options.port or 5280, options.path or "files", options.ssl or false, options.interface;
|
||||
elseif type(options) == "string" then
|
||||
base = options;
|
||||
end
|
||||
httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue