| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
idiomatic XMPP library for node.js
Now usable in browsers too thanks to Browserify.
With package manager npm:
npm install node-xmpp
Optional
Inheritance tree and associations:
┌────────────┐1 1┌────────────┐
│ net.Stream ├───────┤ Connection │
└────────────┘ └────────────┘
↑
┌────────────┬───────┴───┬────────────┐
│ │ │ │
┏━━━━━┷━━━━┓ ┏━━━━━┷━━━━━┓ ┌───┴────┐ ┌─────┴─────┐
┃ Client ┃ ┃ Component ┃ │ Server │ │ C2SStream │
┗━━━━━━━━━━┛ ┗━━━━━━━━━━━┛ └────────┘ └───────────┘
↑ ↑0..*
┌─────────────────────┤ │accepts
│ │ │1
┌────────┴───────┐ ┌───────────┴────┐ ┏━━━━━┷━━━━━┓
│ OutgoingServer │ │ IncomingServer │ ┃ C2SServer ┃
└─────────────┬──┘ └───┬────────────┘ ┗━━━━━┯━━━━━┛
0..* │ │ 0..* │
creates │ │ accepts │
┏┷━━━━━━━━┷┓ │
┃ Router ┃←──────────────────┘
┗━━━━━━━━━━┛ 1
This foundation is complemented by two basic data structures:
Strophe.js' XML Builder is very convenient for producing XMPP stanzas. ltx includes it in a much more primitive way: the c(), cnode() and t() methods can be called on any Element object, returning the new child element.
This can be confusing: in the end, you will hold the last-added child until you use up(), a getter for the parent. Connection.send() first invokes tree() to retrieve the uppermost parent, the XMPP stanza, before sending it out the wire.
| Back | FazBrowse Home | New Git URL |