Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
patch client-side Meteor functions to print out the DDP messages. Add this somewhere in your client-side JS before Meteor.startup() and it should print out the DDP messages. Please let me know if there are some that are missing! I'm not sure I caught all of the handler functions.
var monkeyPatches = {
'_livedata_data': 'DATA',
'_livedata_error': 'ERROR',
'_livedata_nosub': 'NOSUB',
'_livedata_connected': 'CONNECTED',
'_livedata_result': 'RESULT',
var modifiedFunctionName = funcName+'_original';
var extension = {};
extension[modifiedFunctionName] = Meteor.default_connection[funcName];
_.extend(Meteor.default_connection, extension);
Meteor.default_connection[funcName] = function(msg){
console.log(monkeyPatches[funcName]+': ');
var originalSend = Meteor.default_connection._stream.send;
'originalSend': originalSend,
Meteor.default_connection._stream.send = function(data) {
console.log('SENDING: ');
Copy link

TimHeckel commented Jan 10, 2013

this might prove to be very useful...thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment