aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/s2s
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/s2s')
-rw-r--r--plugins/s2s/mod_s2s.lua6
-rw-r--r--plugins/s2s/s2sout.lib.lua5
2 files changed, 9 insertions, 2 deletions
diff --git a/plugins/s2s/mod_s2s.lua b/plugins/s2s/mod_s2s.lua
index 1fa8ae81..ad7f4862 100644
--- a/plugins/s2s/mod_s2s.lua
+++ b/plugins/s2s/mod_s2s.lua
@@ -464,9 +464,13 @@ end
s2sout.set_listener(listener);
-require "core.portmanager".register_service("s2s", {
+module:add_item("net-provider", {
+ name = "s2s";
listener = listener;
default_port = 5269;
encryption = "starttls";
+ multiplex = {
+ pattern = "^<.*:stream.*%sxmlns%s*=%s*(['\"])jabber:server%1.*>";
+ };
});
diff --git a/plugins/s2s/s2sout.lib.lua b/plugins/s2s/s2sout.lib.lua
index f9f9d362..6ee1ca83 100644
--- a/plugins/s2s/s2sout.lib.lua
+++ b/plugins/s2s/s2sout.lib.lua
@@ -316,7 +316,10 @@ module:hook_global("service-added", function (event)
if event.name ~= "s2s" then return end
local s2s_sources = portmanager.get_active_services():get("s2s");
-
+ if not s2s_sources then
+ module:log("warn", "s2s not listening on any ports, outgoing connections may fail");
+ return;
+ end
for source, _ in pairs(s2s_sources) do
if source == "*" or source == "0.0.0.0" then
if not socket.local_addresses then