aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-12-08 04:47:51 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-12-08 04:47:51 +0500
commitf630bfdc92decfc06a6867e2e3124fbd002f77ec (patch)
treec755a03cbb58a2fdfede8272489f84c89bfedd4f /prosody
parent0100a7083142a2350b3a5b7f3d11ad7f13eb8b5c (diff)
downloadprosody-f630bfdc92decfc06a6867e2e3124fbd002f77ec.tar.gz
prosody-f630bfdc92decfc06a6867e2e3124fbd002f77ec.zip
Added: Ports now read from the config
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody21
1 files changed, 19 insertions, 2 deletions
diff --git a/prosody b/prosody
index 042d0212..cce5ba83 100755
--- a/prosody
+++ b/prosody
@@ -146,8 +146,25 @@ if global_ssl_ctx then
end
-- start listening on sockets
-cl.start("xmppclient", { ssl = global_ssl_ctx })
-cl.start("xmppserver", { ssl = global_ssl_ctx })
+local function do_ports(option, listener, default, key)
+ local ports = config.get("*", "core", option) or default;
+ --if type(ports) == "number" then ports = {ports} end;
+ if type(ports) ~= "table" then
+ log("error", "core."..option.." is not a table");
+ else
+ for _, port in ipairs(ports) do
+ if type(port) ~= "number" then
+ log("error", "Non-numeric "..option..": "..tostring(port));
+ else
+ cl.start(listener, { ssl = global_ssl_ctx, [key] = port });
+ end
+ end
+ end
+end
+
+do_ports("c2s_ports", "xmppclient", {5222}, "port");
+do_ports("s2s_ports", "xmppserver", {5269}, "port");
+do_ports("legacy_ssl_ports", "xmppclient", {}, "legacy_ssl_port");
if config.get("*", "core", "console_enabled") then
if cl.get("console") then