# HG changeset patch # User Emmanuel Gil Peyrot # Date 1305818476 -7200 # Node ID 8acaa0a575c76eb7362859eeecc52700721862de # Parent 805f24754ff1262d5f6cf35ba245b1eb4420702a Allow configuration of the host. diff --git a/avatar.js b/avatar.js --- a/avatar.js +++ b/avatar.js @@ -24,12 +24,7 @@ var config = require('./configuration'); try { var xmpp = require('node-xmpp'); - var conn = new xmpp.Component({ - jid: config.jid, - password: config.password, - host: 'localhost', - port: 5347 - }); + var conn = new xmpp.Component(config); conn.on('stanza', function (stanza) { if (stanza.is('iq')) @@ -46,7 +41,7 @@ try { var Element = require('ltx').Element; } catch (e) { var xmpp = require('xmpp'); - var conn = new xmpp.Connection(); + var conn = new xmpp.Connection(config.host, config.port); conn.log = function (_, m) { console.log(m); }; diff --git a/configuration.js b/configuration.js --- a/configuration.js +++ b/configuration.js @@ -21,5 +21,7 @@ var config = exports; config.jid = 'avatar.example.org'; +config.host = 'localhost'; +config.port = 5347; config.password = 'hellohello'; -config.directory = 'data'; +config.directory = 'data'; // Directory of the cache.