aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-10 10:49:32 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-10 10:49:32 +0100
commit06626f77c6abf544089fd9ebacca1940e34d35ae (patch)
tree4bdebc9d726d5b99dd2f26f10aa3cc6588518b64 /prosody
parente99f46bcdad7defcebf98bbca3363bf05552aba9 (diff)
downloadprosody-06626f77c6abf544089fd9ebacca1940e34d35ae.tar.gz
prosody-06626f77c6abf544089fd9ebacca1940e34d35ae.zip
Allow config to specify listening interfaces
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody17
1 files changed, 11 insertions, 6 deletions
diff --git a/prosody b/prosody
index 0d735e70..df72cfcc 100755
--- a/prosody
+++ b/prosody
@@ -123,7 +123,7 @@ end
-- start listening on sockets
function net_activate_ports(option, listener, default, conntype)
- local ports = config.get("*", "core", option) or default;
+ local ports = config.get("*", "core", option.."_ports") or default;
if type(ports) == "number" then ports = {ports} end;
if type(ports) ~= "table" then
@@ -131,17 +131,22 @@ function net_activate_ports(option, listener, default, conntype)
else
for _, port in ipairs(ports) do
if type(port) ~= "number" then
- log("error", "Non-numeric "..option..": "..tostring(port));
+ log("error", "Non-numeric "..option.."_ports: "..tostring(port));
else
- cl.start(listener, { ssl = conntype ~= "tcp" and global_ssl_ctx, port = port, type = conntype });
+ cl.start(listener, {
+ ssl = conntype ~= "tcp" and global_ssl_ctx,
+ port = port,
+ interface = config.get("*", "core", option.."_interface"),
+ type = conntype
+ });
end
end
end
end
-net_activate_ports("c2s_ports", "xmppclient", {5222}, (global_ssl_ctx and "tls") or "tcp");
-net_activate_ports("s2s_ports", "xmppserver", {5269}, "tcp");
-net_activate_ports("legacy_ssl_ports", "xmppclient", {}, "ssl");
+net_activate_ports("c2s", "xmppclient", {5222}, (global_ssl_ctx and "tls") or "tcp");
+net_activate_ports("s2s", "xmppserver", {5269}, "tcp");
+net_activate_ports("legacy_ssl", "xmppclient", {}, "ssl");
if config.get("*", "core", "console_enabled") then
if cl.get("console") then