aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-01-13 05:55:31 +0000
committerMatthew Wild <mwild1@gmail.com>2009-01-13 05:55:31 +0000
commit8b979ccaf40ae38dbeaa5e7a4edb2e6d760fdffa (patch)
tree7b1823951740e4390c8eea4a1ec16839a3d4fb44 /plugins
parent393b7385885eb8ec8e9e93daf31a365480b127a9 (diff)
downloadprosody-8b979ccaf40ae38dbeaa5e7a4edb2e6d760fdffa.tar.gz
prosody-8b979ccaf40ae38dbeaa5e7a4edb2e6d760fdffa.zip
BOSH: Allow BOSH servers to be configured through config file
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index 2cf35524..b5951e96 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -253,5 +253,17 @@ function on_timer()
end
end
-httpserver.new{ port = 5280, base = "http-bind", handler = handle_request, ssl = false}
+local ports = config.get(module.host, "core", "bosh_ports") or { 5280 };
+for _, options in ipairs(ports) do
+ local port, base, ssl, interface = 5280, "http-bind", 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 "http-bind", 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
+
server.addtimer(on_timer);