[rabbitmq-discuss] RabbitMQ's WebSocket broken

Petri Luojus luojus at gmail.com
Fri Oct 18 12:04:57 BST 2013


Hi,

stomp.js is the latest, found in
https://github.com/jmesnil/stomp-websocket/blob/master/lib/stomp.js.
I'm using the following code. Note, that I'm not using SockJS.

var client = Stomp.client('ws://vm0077.virtues.fi:15674/stomp/websocket');
client.heartbeat.outgoing = 20000;
client.heartbeat.incoming = 0;

client.debug = function(str) {
$("#debug").append(str + "\n");
};

var on_connect = function() {
subId = client.subscribe('/exchange/capacity/nothing.special',
handleMessage);
console.log('connected');
var data = "Hello World!";
client.send('/exchange/capacity/nothing.special', {}, data);
};

var handleMessage = function(d) {
$("#messages").append(d.body + "\n");
};

var on_error =  function(error) {
console.log(error);
};

client.connect('user', 'pass', on_connect, on_error, '/');

Br,
Petri

Petri Luojus
+358 41 437 3592
Oulu, Finland
luojus at gmail.com



On Fri, Oct 18, 2013 at 1:43 PM, Emile Joubert <emile at rabbitmq.com> wrote:

>
> Hi,
>
> On 11/10/13 07:58, Petri Luojus wrote:
>
> > GET /stomp/websocket HTTP/1.1
> > Upgrade: websocket
> > Connection: Upgrade
> > Host: xxx.yyy:15674
> > Origin: null
> > Sec-WebSocket-Protocol: v10.stomp, v11.stomp
> > Pragma: no-cache
> > Cache-Control: no-cache
> > Sec-WebSocket-Key: YRpCwsRP6s2ounZHK4soEQ==
> > Sec-WebSocket-Version: 13
> > Sec-WebSocket-Extensions: x-webkit-deflate-frame
> > User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36
> > (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36
> > Cookie: auth=bHVvanVzOk15aGthbGU1;
> >
> m=1933:600%7C5|2377:large|2491:chart|2663:t|6967:t|34e2:|4e99:t|2c69:t|2a03:t|745a:t|77cb:t|5cf4:t|3a95:avg|54b5:small|29b3:60%7C5|3a8e:chart|54ae:small|29ac:600%7C5|47ba:t|e69:chart|45b9:600%7C5|4a01:t|ca3:t|79d4:chart|640c:small|678e:60%7C5|4e71:large|4d66:500|1d98:t|6cfc:t|15cc:t
> >
> > HTTP/1.1 101 Switching Protocols
> > Upgrade: websocket
> > Sec-Websocket-Accept: DGeZKxS98lD43p+4Gkhb17W29E0=
> > Connection: Upgrade
>
> Can you confirm what the code you used to generate these headers, and
> which revision of stomp.js? I get slightly different headers and no
> error when I use the latest version of Chrome and the web stomp examples
> that ship in
>
>   http://hg.rabbitmq.com/rabbitmq-web-stomp-examples/
>
>
> GET ws://localhost:15674/stomp/584/zw7on1yc/websocket HTTP/1.1
> Pragma: no-cache
> Origin: http://localhost:15670
> Host: localhost:15674
> Sec-WebSocket-Key: VE4morwMfRKFtxmcVUdddQ==
> User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
> like Gecko) Chrome/30.0.1599.101 Safari/537.36
> Upgrade: websocket
> Sec-WebSocket-Extensions: x-webkit-deflate-frame
> Cache-Control: no-cache
> Connection: Upgrade
> Sec-WebSocket-Version: 13
>
> HTTP/1.1 101 Switching Protocols
> Connection: Upgrade
> Sec-Websocket-Accept: x4EO4xRPJ3Cc9kzEnvlv2ToCSvc=
> Upgrade: websocket
>
>
>
>
>
> -Emile
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131018/406964db/attachment.htm>


More information about the rabbitmq-discuss mailing list