Code Monkey home page Code Monkey logo

Comments (5)

oberstet avatar oberstet commented on June 12, 2024

At least with WebSocket as transport, the WAMP protocol version spoken is still accessible before even receiving any WAMP level message.

This is because v1 and v2 use different WebSocket subprotocol identifiers: wamp for WAMP v1, and wamp.2.json (...) for WAMP v2.

A client that supports both WAMP versions can connect to a server request WebSocket subprotocols ["wamp.2.json", "wamp"].

If the server only speaks WAMP v1, it'll answer chosing wamp as subprotocol. If the server speaks WAMP v2, it'll answer chosing wamp.2.json.

The client can access the negotiated WebSocket subprotocol right after the WebSocket connection has been established, and before even the first message is received.

from wamp-proto.

beatgammit avatar beatgammit commented on June 12, 2024

Ok. That makes sense.

But there's no analog for other transports. What will happen if the session initialization handshake changes in a future WAMP version? Would this be a case where the HELLO message would send what protocols it supports in the options argument? It seems like it would be useful to know what version of the protocol the server is expecting before the session initialization handshake (or at least part of it).

from wamp-proto.

oberstet avatar oberstet commented on June 12, 2024

Correct. The use of WebSocket subprotocols to signal protocol version only works with WebSocket transports. However, WAMPv1 never supported anything else.

With WAMPv2, the HELLO and WELCOME messages (deliberately) do not include protocol "version", but the actual feature set supported. The use of role & feature announcement instead of protocol versioning is deliberate ..

I have added text to the spec trying to clarify above hopefully:

https://github.com/tavendo/WAMP/blob/master/spec/basic.md#supporting-wamp-v1-and-v2
https://github.com/tavendo/WAMP/blob/master/spec/basic.md#client-role-and-feature-announcement
https://github.com/tavendo/WAMP/blob/master/spec/basic.md#router-role-and-feature-announcement

from wamp-proto.

oberstet avatar oberstet commented on June 12, 2024

If you still think "protocol version" is necessary / better than "feature announcement", please reopen ..

from wamp-proto.

beatgammit avatar beatgammit commented on June 12, 2024

The major version is still useful and orthogonal to "feature announcement". If, for example, "feature announcement" changes in v3, the major protocol version can indicate this, and a single library can handle multiple protocol versions.

I'm thinking the handshake should look like this:

  • client/server transport initialization
  • client/server agree on serialization format
  • server announces major protocol version(s)
  • client sends HELLO to begin session

This is part of the WebSocket spec, but not part of other transports. I'm not sure if this should be part of the WAMP messaging protocol or just a requirement for transports, but I think this information needs to be established between client and server, especially with the pluggable nature of WAMP.

This may not be a big deal for v1 compat (since WebSockets were the only transport available), but I think something should be decided to make it easier going forward. If WAMP becomes common-place, it would be nice to upgrade routers without having to rewrite every endpoint connecting to them.

from wamp-proto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.