Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view WS/WSS Websocket request content using Firebug or other?

Is there a way to view the Websocket traffic?

Only Websocket headers are visible on the initial handshake.

Everything disappears after the response:

Connection  Upgrade Sec-WebSocket-Accept    EQqklpK6bzlgAAOL2EFX/nx8bEI= Upgrade WebSocket 

I've tried Firebug, Live Headers, and Fiddler2 to trace the exchange and they all stop logging there.

like image 302
Stevko Avatar asked Feb 10 '12 00:02

Stevko


2 Answers

Try Chrome's developer tools,

  1. click 'Network' tab
  2. use the filters at the bottom to show only WebSocket connections),
  3. select the desired websocket connection,
  4. note that there are 'Headers', 'Preview', 'Response', etc. sub-tabs to the right,
  5. once data starts flowing a 'WebSocket Frames' subtab will appear. All data going in either direction is logged. Very informative.
like image 156
Daniel Shields Avatar answered Oct 30 '22 12:10

Daniel Shields


As of 3, September 2014, it seems that WebSocket debugging in FireBug is in the hose : https://getfirebug.com/wiki/index.php/Firebug_2.0_Roadmap#Feature_Overview. But no release date is mentioned.


Update 2019-09-19

See this interesting Mozilla Hacks article.


Update 2017-11-24 The plugin system in Firefox changed. Websocket Monitor is at the moment of writing unavailable :(


Update 2016-04-06

WebSocket debugging in Firefox is finally possible using the Websocket Monitor addon for the Firefox Dev Tools! It is developed by the Firebug development team and its sources can be found here.


Update 2015-10-28

Jeff Griffiths, Product Manager for Firefox Developer Tools:

platform support is in nightly today & a prototype add-on is being worked on here: https://github.com/firebug/websocket-monitor

https://twitter.com/canuckistani/status/659399140590284800

Relevant feature request on the Firefox Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1203802


Update as of 2015-04-08

Fiddler 4.5 can now inspect WebSocket traffic natively.


Update 2014-09-11

Regarding this comment on the Firebug issue tracker :

It's currently off the radar as the Firebug team is working on integrating Firebug with the DevTools at the moment. This means it will be able to reuse the features provided by the built-in DevTools. You may therefore follow https://bugzil.la/885508.

like image 38
Epoc Avatar answered Oct 30 '22 14:10

Epoc