如何查看meteor DDP流量? [英] how to view meteor DDP traffic?
问题描述
meteor 在socks/websockets 上使用DDP.我如何获得浏览器调试控制台中正在发生的事情的任何类型的视图?在 chrome 的网络面板中,至少只有一个websocket"连接,没有太多关于通过它运行的流量的信息.
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.
我知道 arunoda 的 DDP 分析器和代理,但一直在寻找其他方法获取基本的交通信息.我原以为 chrome 的调试工具会对 HTTP 以外的协议提供更多支持,并且有兴趣了解其他人认为有用的其他内容.
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.
推荐答案
您可以尝试将消息记录为一个简单的起点.解析消息让检查变得更好一些.
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));
});
}
这篇关于如何查看meteor DDP流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!