Skip to content

Instantly share code, notes, and snippets.

@jasmo2
Created April 9, 2016 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasmo2/9e30022896a9ea067efe39432042c7bf to your computer and use it in GitHub Desktop.
Save jasmo2/9e30022896a9ea067efe39432042c7bf to your computer and use it in GitHub Desktop.
(function() {
module.exports = {
/**
* Before connection (optional, just for faye)
* @param {client} client connection
*/
beforeConnect : function(client) {
// Example:
// client.setHeader('Authorization', 'OAuth abcd-1234');
client.disable('websocket');
},
/**
* On client connection (required)
* @param {client} client connection
* @param {done} callback function(err) {}
*/
onConnect : function(client, done) {
// Faye client
// client.subscribe('/channel', function(message) { });
// Socket.io client
client.emit('new-messageLatido', {
idMascota: "1",
idCollar: "1",
idUsuario: "1",
latido: "15",
fecha: "2016/01/01 13:01:01"
});
done();
// Primus client
// client.write('Sailing the seas of cheese');
// WAMP session
// client.subscribe('com.myapp.hello').then(function(args) { });
},
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment