XMPP-FTW (For the Web/Win) ::: Powerful XMPP, simple JSON
The goal of this project is to make XMPP really simple to use for developers. This module takes away all of the XML and works by hooking to events which are passed between client and server using a transport in JSON. In the example code we use socket.io, but there is no reason this can not be replaced with engine.io, or implement your own transport and pass in as a connection.
The code is now up and running at https://xmpp-ftw.jit.su so you can try it out. Be aware that this setup is only for trying xmpp-ftw out and may be slow as we need to go client ↔ nodejitsu (east coast US) ↔ your XMPP server and back each time.
The version running on the website matches 'master' branch here and auto-deploys with commits.
Also check out the xmpp-ftw-demo repository which is what https://xmpp-ftw.jit.su is running.
Logging is handled using a Winston like interface but by default
does not record any logging (uses a null logger). Developers can inject any logging platform they wish
provided it uses the same interface as Winston. In order to inject a logger simply call
the main XMPP-FTW object after instantiation.
Methods used in XMPP-FTW projects are:
If you want to run xmpp-ftw server side (e.g. to write a bot) then this should be a good starting point:
var xmppFtw = require'xmpp-ftw'var Emitter = require'events'EventEmittervarthisserver =thisclient =var self = thisselfclientemitevent data rsm callbackselfserveremitevent data callbackthisserveronevent data rsmthisserversendevent data callbackthisserverremoveAllListenerseventvar socket =var client = socketsocketclienton'xmpp.connection'console.log'Connected' datasocketclienton'xmpp.error'console.log'error' errorsocketclienton'xmpp.error.client'console.log'client error' errorsocketclientsend'xmpp.login' login: 'detiails' here: truesocketclientsend'xmpp.chat.message'to: 'email@example.com'content: 'Hello world'console.logerror data
License is Apache 2.0, please let me know if this doesn't suit.