73 local target = validate_dnsname_option(opts, "target", module:context(vhost):get_option_string("xmpp_host", ihost)); |
73 local target = validate_dnsname_option(opts, "target", module:context(vhost):get_option_string("xmpp_host", ihost)); |
74 -- TODO validate that target has A/AAAA |
74 -- TODO validate that target has A/AAAA |
75 |
75 |
76 local configured_ports = { |
76 local configured_ports = { |
77 ["xmpp-client"] = module:get_option_array("c2s_ports", { 5222 }); |
77 ["xmpp-client"] = module:get_option_array("c2s_ports", { 5222 }); |
78 ["xmpp-server"] = module:get_option_array("c2s_ports", { 5269 }); |
78 ["xmpp-server"] = module:get_option_array("s2s_ports", { 5269 }); |
79 ["xmpps-client"] = module:get_option_array("c2s_direct_tls_ports", {}); |
79 ["xmpps-client"] = module:get_option_array("c2s_direct_tls_ports", {}); |
80 ["xmpps-server"] = module:get_option_array("c2s_ports", {}); |
80 ["xmpps-server"] = module:get_option_array("s2s_direct_tls_ports", {}); |
81 }; |
81 }; |
82 |
82 |
83 if opts.multiplex then |
83 if opts.multiplex then |
84 for opt, ports in pairs(configured_ports) do |
84 for opt, ports in pairs(configured_ports) do |
85 ports:append(module:get_option_array(opt:sub(1, 5) == "xmpps" and "ssl_ports" or "ports", {})); |
85 ports:append(module:get_option_array(opt:sub(1, 5) == "xmpps" and "ssl_ports" or "ports", {})); |