[Pkg-javascript-commits] [ltx] 64/469: s2s TODO + half example
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 13:01:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository ltx.
commit ea20db42a3d51f0b507804861e00de05f25e300b
Author: Astro <astro at spaceboyz.net>
Date: Sat Sep 4 20:07:24 2010 +0200
s2s TODO + half example
---
examples/echo_server.js | 8 ++++++++
lib/xmpp/router.js | 12 +++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/examples/echo_server.js b/examples/echo_server.js
new file mode 100644
index 0000000..a632a66
--- /dev/null
+++ b/examples/echo_server.js
@@ -0,0 +1,8 @@
+var xmpp = require('../lib/xmpp');
+
+var r = new xmpp.Router();
+r.send(new xmpp.Element('message', { from: 'test at codetu.be',
+ to: 'astro at spaceboyz.net',
+ type: 'chat' }).
+ c('body').t('Hello, World')
+ );
diff --git a/lib/xmpp/router.js b/lib/xmpp/router.js
index d7d5d11..74edf36 100644
--- a/lib/xmpp/router.js
+++ b/lib/xmpp/router.js
@@ -34,6 +34,7 @@ DomainContext.prototype.getOut = function(domain) {
} else {
var outStream = this.s2sOut[domain] =
Server.makeOutgoingServer(domain);
+ dbgStream('outgoing', outStream);
outStream.dbKey = generateKey();
outStream.addListener('online', function() {
outStream.dialbackKey(self.domain, domain, outStream.dbKey);
@@ -58,7 +59,6 @@ DomainContext.prototype.getOut = function(domain) {
delete self.s2sOut[domain];
});
- dbgStream('outgoing', outStream);
return outStream;
}
};
@@ -91,6 +91,16 @@ DomainContext.prototype.verifyDialback = function(domain, id, key) {
return false;
};
+/**
+ * TODO:
+ * * recv stanzas
+ * * send on incoming?
+ * * karma
+ * * nameprep
+ * * listening
+ * * allow only to hosted domains
+ * * timeouts
+ */
function Router(s2sPort) {
var self = this;
this.ctxs = {};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git
More information about the Pkg-javascript-commits
mailing list