MyMedsAndMe / spell

Spell is a Web Application Messaging Protocol (WAMP) client implementation in Elixir. WAMP is an open standard WebSocket subprotocol that provides two application messaging patterns in one unified protocol: Remote Procedure Calls + Publish & Subscribe: http://wamp.ws/
Apache License 2.0
66 stars 25 forks source link

Realm Required #51

Closed awochna closed 7 years ago

awochna commented 7 years ago

I'm trying to make a connection to a WAMP Websocket, starting with code like the following

subscriber = Spell.connect(uri, roles: [Spell.Role.Subscriber])

However, I get back {:error, :realm_required}. The particular service I'm trying to connect and subscribe to does not have separate realms and I have been unable to find that realms are indeed required in the WAMP specification anywhere, so I have no evidence thus far that the service is implementing the protocol incorrectly.

jtmoulia commented 7 years ago

Hi @awochna! Thanks for the feedback -- I could imagine getting rid of the client side realm check and leaving it up to the server, but as far as I can tell realms are_ part of the WAMP protocol (emphasis mine):

A Realm is a WAMP routing and administrative domain, optionally protected by authentication and authorization. WAMP messages are only routed within a Realm.

http://wamp-proto.org/static/rfc/draft-oberstet-hybi-crossbar-wamp.html#rfc.section.3

awochna commented 7 years ago

Thanks for getting back to me, @jtmoulia!

I read that it is a part and I understand the realms-as-namespaces idea for the router, but the particular service I'm using doesn't have separate realms and the spec didn't say that realms are required between the client and router. Because realms are enforced in this module, I can't use it for connecting to the service.

Just for clarity, the particular service I'm trying to connect to is the Poloniex Push API.

jtmoulia commented 7 years ago

Weird -- the WAMP spec describes a HELLO message as:

[HELLO, Realm|uri, Details|dict]

Does Poloniex expect a nil value for Realm?

Just to double check, have you tried connecting using realm1? Linked from your link: https://pastebin.com/dMX7mZE0

Cheers

Alex Wochna writes:

Thanks for getting back to me, @jtmoulia!

I read that it is a part and I understand the realms-as-namespaces idea for the router, but the particular service I'm using doesn't have separate realms and the spec didn't say that realms are required between the client and router. Because realms are enforced in this module, I can't use it for connecting to the service.

Just for clarity, the particular service I'm trying to connect to is the Poloniex Push API.

awochna commented 7 years ago

I should look at the examples more closely, it seems. Thanks for your help @jtmoulia !