dual-engine.io
v0.1.3
Published
Send dual-protocol messages over engine.io connections
Downloads
3
Readme
dual-engine.io
Allows a dualapi
domain
mounted on a server side to communicate with a dualapi
domain
mounted in a browser via engine.io.
A simple demonstration is in
./example
.
The client side transport is provided in
dual-engine.io-client
.
In general, the server side dualapi
domain is connected by providing
a connected engine.io socket:
var dualapi = require('dualapi')
.use(require('dual-engine.io'));
var domain = dualapi();
domain.mount(['connect', '::client'], function (body, ctxt) {
// a client connected! say hello!
ctxt.send({
to: ctxt.params.client.concat('hello'),
body: 'Helloooo!'
});
});
var io = require('engine.io').listen(3000);
io.on('connection', function (socket) {
return domain.engineio(socket);
});