Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (43 sloc) 1.787 kb
+--------------------------------------------------+
| Embedding node-xmpp-bosh in your own application |
+--------------------------------------------------+
var nxb = require('node-xmpp-bosh');
var server = nxb.start({
logging: "WARN",
port: 5280,
path: /^\/http-bind(\/+)?$/
});
server.on(EVENT, HANDLER);
The 'server' variable is an object of type EventPipe. The
EventPipe API is similar to node.js' EventEmitter API except
that it allows you to pipe (and hence mutate events or stop
event propagation altogether) events from one listener to
another.
EVENT and HANDLER are defined as follows:
Raised by the BOSH server
-------------------------
01. 'stream-add' => function(stream_state)
02. 'stream-restart' => function(stream_state, stream_attrs)
03. 'stream-terminate' => function(stream_state)
04. 'response-acknowledged' => function(wrapped_response, state)
05. 'error' => function(exception)
06. 'no-client' => function(response_object)
07. 'nodes' => function([node], stream_state)
Listened to by the BOSH server
------------------------------
08. 'terminate' => function(stream_state, had_error)
09. 'stream-added' => function(stream_state)
10. 'response' => function(response, stream_state)
Raised by the WEBSOCKET server
------------------------------
01. stream-add
02. nodes
03. stream-terminate
04. stream-restart
05. error
Listened to by the WEBSOCKET server
-----------------------------------
06. stream-added => function(stream_state)
07. response => function(response, stream_state)
08. terminate => function(stream_state, had_error)
09. stream-restarted => function(stream_state, stanza)
Jump to Line
Something went wrong with that request. Please try again.