From 06626f77c6abf544089fd9ebacca1940e34d35ae Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 10 Apr 2009 10:49:32 +0100 Subject: Allow config to specify listening interfaces --- prosody | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'prosody') 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 -- cgit v1.2.3