New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support WAMPv2 #168
Comments
A first question would be: which roles do you want to implement from the "Basic Profile"? You could target the roles Caller, Callee, Publisher and Subscriber (this is what AutobahnJS and AutobahnAndroid do). This will let users implement application logic that acts under these roles under Ratchet/PHP. However, in a complete system, users will then need an external WAMP router. Users should be free to plug in any WAMP v2 compliant router. (1) Or you could target all roles and also allow Ratchet to act as a router itself. (2) In this case, there is then still the question if you allow application components written by users run both as in (1) and (2). This is what AutobahnPython does. |
(Grim) |
Hi guys! |
Would be nice to have somewhere stated, that this latest version is incompatible with linked last version of autobahn.js - due to WAMP version. |
I'd suggest starting with Caller, Callee, Publisher, and Subscriber to fill the implementation of what is currently existing in Ratchet. I haven't had the free time to read through the WAMPv2 specification yet (life+job too much atm) so I can't suggest a proper roadmap. Without looking I'd probably suggest following what AutobahnPython does and what Ratchet has done so far: loosely couple into small parts that can be combined together for maximum flexibility and try to match the client API as much as possible. |
Trying to collect more info: |
Chris! If you can just prepare a backbone, or point where to start, i think, i can start dev. |
@oberstet Ratchet doesn't have an official client but I've made one with it before quite easily thanks to the architecture of the library. With the layering of middlewares/components Ratchet is already an acting HTTP server; it's just focused/advertised as a WebSocket server. Also React's even loop is the core of Ratchet so anything in React can be combined with Ratchet. @KSDaemon I have a tight deadline at work next week so I can try to prepare a backbone for you after that. |
Just for the reference: AutobahnJS v0.9.0+ requires a WAMPv2 compatible server and is not compatible with Ratchet. This is also the version you get to download when accessing the latest version. You can still access the Autobahn Legacy (WAMP v1) which is compatible with Ratchet. This has been confirmed to work with at least up to v0.8.2. |
Current status? It's being implemented in some branch? Thanks |
@endel There hasn't been any progress on this. I have too much on my plate at the moment to code this. I'm hoping someone is willing to initiate and collaborate towards a PR. |
Unfortunately I'm unable to use Ratchet WAMP at all since there don't appear to be any JS libraries that support WAMP v1 and also work well with commonjs (browserify, webpack). I wasted a lot of time on that mess. |
@dschissler I'm using AutobahnJS 0.8.2 release, which is compatible with WAMP v1 in production: https://github.com/tavendo/AutobahnJS/releases/tag/v0.8.2 Sure it would be awesome if Ratchet add support to WAMP v2. |
Are you usiing it with browserify or webpack? |
@dschissler Yep, AutobahnJS 0.8.2 is the latest version that supports WAMP v1. It's no longer under development. You can find docs and downloads for that version here: http://autobahn.ws/js/reference_wampv1.html Note: that version does not require browserify for building the library, since it only runs in a browser anyway. Newer versions of AutobahnJS (WAMP v2) do use browserify for building, since it supports both NodeJS and Browser environments. A last note: WAMP v2 support in Ratchet would be great. An alternative is Thruway, which is a PHP/React WAMP v2 client (and router) implementation. That works great with latest AutobahnJS, e.g. together with Crossbar.io (an advanced WAMP router). It's easy to get started http://crossbar.io/docs/Getting-started-with-PHP/ and this is how PHP app components look like https://github.com/crossbario/crossbar/blob/master/crossbar/crossbar/templates/hello/php/client.php |
@oberstet thanks for the heads up on Thruway. I see that it uses Ratchet as an underlying library so I suppose that the WAMP2 implementation is just their take on it. I'm unsure why they are not just adding this to React as the author seems to be open to pulling code although he is a bit busy at the moment as many people are now. I'm going to ask the Thruway people to give a brief statement as to their intent. I'm a bit confused with them requiring Ratchet. |
@dschissler - We actually did start Thruway with the intent of it begin part of Ratchet. Before we were able to get to the point of making a pull request, there was already another request pending. The way we were implementing the WAMPv2 protocol was much different than the pending PR, and after some consideration, we felt it made more sense to have it as a separate project anyway. The WAMPv2 spec talks about other transports, and actually has other implementations than just a WebSocket server. Ratchet is a great library and @cboden does an incredible job on the work in Ratchet, Pawl (which is the WebSocket client we use), and also React - which our project is built around. We wanted to build a project that would allow more than just a WebSocket server as a transport. For that reason, it didn't make sense for us to package Thruway inside of a WebSocket server library. Thruway is also a WAMPv2 client (so you can connect to the server from other PHP projects as well as crossbar, autobahn, or any other WAMPv2 server), and we will likely add other transports as needed. |
@mbonneau this is interesting! thanks for explaining the background. here are my notes: I have now added a description of "WAMP-over-RawSocket" to the AP of the spec: https://github.com/tavendo/WAMP/blob/master/spec/advanced.md#raw-socket-transport It's trivial. WAMP-over-RawSocket is interesting since it has lower overhead in terms of CPU. For a WAMP component connecting to a Router locally (e.g. TCP loopback), this can make a lot of sense. Ideally, Thruway would also support running over Unix Domain Socket. This is the most efficient transport for local WAMP components: WAMP-over-RawSocket running over Unix Domain Sockets It is more efficient than WAMP-over-WebSocket (less CPU), and more efficient than loopback TCP (less CPU and less data being copied around). When 2 processes talk over loopback TCP, the data still needs to go through all the TCP stack processing, and is copied (at least) twice: userspace -> kernelspace -> userspace. With Unix Domain Socket, data sent is copied directly to the receiving process address space. Also there is not TCP stack processing whatsoever. You can shuffle something like 1-10 GB/s over Unix Domain Socket with low CPU load. Crossbar.io support all variants: http://crossbar.io/docs/Router-Transports/ @cboden sorry for kind of hijacking this thread. Hope you don't get angry at us. |
@oberstet No worries at all :-) |
I've decided to remove WAMPv2 support from the roadmap, at least for the time being. My free time to contribute to open source has been stretched too thin as it is and with the complexity of the WAMPv2 specification (being more than just a text protocol that the first was) it would take a great amount of time to bring it to the place I'd be satisfactory with. Thankfully the guys at Thruway seem to be picking up my slack and have been working on creating a full WAMPv2 system. I have reached out to @darkl regarding #193 and making it a standalone component. Mr. Zelingher has expressed he does not wish to maintain a PHP project but has given permission for anyone who wishes to maintain a decorator component for Ratchet may use the code from his pull request to do so. refs #231 |
I made a WAMP V2 implementation.Abandoned now, but could be of some use to
|
Please add to README (and web site) information about what Ratchet supports only WAMPv1 and works only with autobahn-v8 |
ratchet have a roadmap to support WAMP v2? there is any eta on int? thanks |
Implement WAMP v2 Basic Profile
The text was updated successfully, but these errors were encountered: