autobahn-js
autobahn-js copied to clipboard
Firefox WebSocket inspector: support for WAMP protocol
- https://bugzilla.mozilla.org/show_bug.cgi?id=1566755
- https://phabricator.services.mozilla.com/D41445
one way (A.) we could do that would be:
- use the WAMP flatbuffer schema files from here https://github.com/crossbario/autobahn-python/tree/master/autobahn/wamp/flatbuffers
- I am the only author of ^ and ok with using any license Mozilla requires in a PR
- use flatc to compile the *.fbs schema source files to binary schema files *.bfbs
- write a Python script that reads *.bfbs binary schema files and generates *.js files with JavaScript classes for all WAMP messages
- write JS glue (see above PR) to add WAMP support to Firefox WebSocket inspector
To read the *.bfbs binary schema files in Python, the flatbuffers package can be used, which contains bindings for the FlatBuffers reflection schema https://github.com/google/flatbuffers/blob/master/reflection/reflection.fbs
alternative approaches would be:
B. reuse AutobahnJS completely (as a full dependency) C. write a set of WAMP message parsing classes from scratch
note: I think the current code in ABJS for parsing WAMP (eg https://github.com/crossbario/autobahn-js/blob/master/packages/autobahn/lib/session.js#L445) is not really suited to be used from outside the library (it wasn't designed to provide that)
Hi Tobias, I wrote a few years ago code that handles WAMP message parsing. You can find it here. It should not be too complicated to integrate this with the inspector, and I might do it, but I'm currently having a hard time setting up a development environment. See also my comment on Bugzilla.
Elad
just wanted to leave a link here .. there now is support for WAMP in Firefox 74: https://github.com/wamp-proto/wamp-proto/issues/362 .. relevant discussion is there