16

meteor uses DDP over socks / websockets. How do i get any type of view of what's going on in the browsers debug console? In the network panel of chrome at least there is just a single "websocket" connection without much info on the traffic running over it.

I'm aware of arunoda's DDP analyzer and proxy but was looking for other ways to get basic information on traffic. I would have thought chrome's debugging tools would have a bit more support for protocols other than HTTP, and interested to know what else others find useful.

dcsan
  • 11,333
  • 15
  • 77
  • 118
  • 5
    in the network tab, if you click the url for the socket to get the details, you can then click the "frames" tab on the entry line to view data sent and received. it doesn't self-refresh, so you have to click another tab (like Headers) and back to frames to see newer data. – dandavis Aug 19 '14 at 00:01
  • [Using Kadira](https://kadira.io/) – albinekb Aug 19 '14 at 06:27
  • Meteor tutorial ([here](https://react-tutorial.meteor.com/simple-todos/06-filter-tasks.html#6-4-Meteor-Dev-Tools-Extension)) suggests the [Meteor DevTools Evolved extension](https://chrome.google.com/webstore/detail/meteor-devtools-evolved/ibniinmoafhgbifjojidlagmggecmpgf) for Chrome. After installation, it adds a "Meteor" tab to the chrome developer tools, where you can inspect the DDP traffic, view local Minimongo data, view active Subscriptions, etc. – vgru Apr 25 '23 at 17:34

1 Answers1

31

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)); 
  });
}
Neil
  • 2,137
  • 16
  • 24