crossbario / autobahn-js

WAMP in JavaScript for Browsers and NodeJS
http://crossbar.io/autobahn
MIT License
1.43k stars 228 forks source link

Firefox WebSocket inspector: support for WAMP protocol #481

Open oberstet opened 4 years ago

oberstet commented 4 years ago
oberstet commented 4 years ago

one way (A.) we could do that would be:

  1. use the WAMP flatbuffer schema files from here https://github.com/crossbario/autobahn-python/tree/master/autobahn/wamp/flatbuffers
  2. I am the only author of ^ and ok with using any license Mozilla requires in a PR
  3. use flatc to compile the *.fbs* schema source files to binary schema files .bfbs**
  4. write a Python script that reads *.bfbs* binary schema files and generates .js** files with JavaScript classes for all WAMP messages
  5. 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

oberstet commented 4 years ago

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)

darkl commented 4 years ago

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

oberstet commented 4 years ago

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