how to view meteor DDP traffic?

寵の児 提交于 2019-11-28 21:27:24

You could try logging the messages as a simple starting point. Parsing the message makes it a little nicer to inspect.

if (Meteor.isClient) {

  // log sent messages
  var _send = Meteor.connection._send;
  Meteor.connection._send = function (obj) {
    console.log("send", obj);
    _send.call(this, obj);
  };

  // log received messages
  Meteor.connection._stream.on('message', function (message) { 
    console.log("receive", JSON.parse(message)); 
  });
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!