Wed, 01 Oct 2008 22:11:28 +0100
Moved hosts to a config file, still need better config though
lxmppd.cfg.dist | file | annotate | diff | comparison | revisions | |
main.lua | file | annotate | diff | comparison | revisions |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lxmppd.cfg.dist Wed Oct 01 22:11:28 2008 +0100 @@ -0,0 +1,25 @@ + + +sessions = {}; +hosts = { + ["localhost"] = { + type = "local"; + connected = true; + sessions = {}; + }; + ["getjabber.ath.cx"] = { + type = "local"; + connected = true; + sessions = {}; + }; + } + +-- If the following is not defined, no SSL will be set up on 5223 +ssl_ctx = { + mode = "server", + protocol = "sslv23", + + key = "/home/matthew/ssl_cert/server.key", + certificate = "/home/matthew/ssl_cert/server.crt", + capath = "/etc/ssl/certs", verify = "none", + }
--- a/main.lua Wed Oct 01 18:51:28 2008 +0500 +++ b/main.lua Wed Oct 01 22:11:28 2008 +0100 @@ -8,6 +8,10 @@ function log(type, area, message) print(type, area, message); end + +dofile "lxmppd.cfg" + +sessions = {}; require "core.stanza_dispatch" require "core.xmlhandlers" @@ -30,26 +34,10 @@ local init_xmlhandlers = xmlhandlers.init_xmlhandlers; ------------------------------ -sessions = {}; -hosts = { - ["localhost"] = { - type = "local"; - connected = true; - sessions = {}; - }; - ["getjabber.ath.cx"] = { - type = "local"; - connected = true; - sessions = {}; - }; - } + local hosts, users = hosts, users; -local ssl_ctx = { mode = "server", protocol = "sslv23", key = "/home/matthew/ssl_cert/server.key", - certificate = "/home/matthew/ssl_cert/server.crt", capath = "/etc/ssl/certs", verify = "none", } - - function connect_host(host) hosts[host] = { type = "remote", sendbuffer = {} }; end