Apaq / StompDart

A Stomp implementation for Dart heavily inspired by StompJS
Apache License 2.0
8 stars 4 forks source link

Add login, passcode, host optional headers to CONNECT frame #7

Closed Dumbris closed 10 years ago

Dumbris commented 10 years ago

According to http://stomp.github.io/stomp-specification-1.1.html#CONNECT_or_STOMP_Frame

michaelkrog commented 10 years ago

Hmm. Wait up.. I'll merge this in and make the changes I just mentioned.

Dumbris commented 10 years ago

My mistake, I forgot to add _header['host'] = line

STOMP spec describe host header as mandatory for 1.1 version. It is ok, to get default host value from socketadapter, and not to force user set it up. But with ability to override it via connect() parameters.

Also note, in really, this is a "virtual host". In my project, I use RabbitMQ with STOMP plugin. And "virtual host" in RabbitMQ provide a way to segregate applications using the same server instance. Also, users can be assigned permissions to specific virtual hosts providing the ability to grant rights. I suppose in other STOMP server implementations virtual host does the same.

michaelkrog commented 10 years ago

Ok. I would just think that the StompClient is so connected to the underlying websocket(or TCP socket), that the url for the socket would almost always point to the same virtual host.

So, just to confirm.

The url you use for the socket does normally NOT contain the same host name as the one you would use in the StompClient?

michaelkrog commented 10 years ago

Hmm. No matter the how its normally used, having a named parameter for host - as you suggested - seems reasonable enough. I'll add it..

Dumbris commented 10 years ago

Ok, thank you.

In rabbitmq virtual hosts is AMQP concept. Usually writen as "/myvhost", the default virtual host is "/"