您如何使用Chrome开发者工具检查websocket流量? [英] How do you inspect websocket traffic with Chrome Developer Tools?
问题描述
我正在尝试使用Chrome开发者工具检查网络套接字流量.从我的研究看来,您应该能够使用网络"标签看到它-甚至还有一个针对"ws"的过滤器.
I'm trying to inspect websocket traffic using Chrome Developer Tools. From my research it seems you should be able to see it using the network tab - and it even has a filter for 'ws'.
但是,我一直在检查我知道正在使用websockets的站点,但是找不到一种方法来检查来回发送的消息.使用Chrome v56,还尝试了Safari并没有运气...
However I've been inspecting sites that I know are using websockets and can't find a way to inspect the messages being sent back and forth. Using Chrome v56, also tried Safari with no luck...
有人知道如何实现吗?
推荐答案
您需要在打开网络标签的情况下重新加载页面,并按"ws"类型进行过滤.这将向您显示与Websocket建立的连接.然后,您可以单击该连接以显示正在服务器上来回发送的流量
You need to reload the page with the network tab open and filter by type 'ws'. This will show you a connection being made with a websocket. You can then click on the connection to show the traffic being sent back and forth with on the server
https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#frames
这篇关于您如何使用Chrome开发者工具检查websocket流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!