<div dir="ltr">Hi,<div><br></div><div>stomp.js is the latest, found in <a href="https://github.com/jmesnil/stomp-websocket/blob/master/lib/stomp.js">https://github.com/jmesnil/stomp-websocket/blob/master/lib/stomp.js</a>.</div>
<div>I'm using the following code. Note, that I'm not using SockJS.</div><div><br></div><div><div>var client = Stomp.client('ws://<a href="http://vm0077.virtues.fi:15674/stomp/websocket'">vm0077.virtues.fi:15674/stomp/websocket'</a>);</div>
<div>client.heartbeat.outgoing = 20000;</div><div>client.heartbeat.incoming = 0;</div><div><br></div><div>client.debug = function(str) {</div><div><span class="" style="white-space:pre">        </span>$("#debug").append(str + "\n");</div>
<div>};</div><div><br></div><div>var on_connect = function() {</div><div><span class="" style="white-space:pre">        </span>subId = client.subscribe('/exchange/capacity/nothing.special', handleMessage);</div><div><span class="" style="white-space:pre">        </span>console.log('connected');</div>
<div><span class="" style="white-space:pre">        </span>var data = "Hello World!";</div><div><span class="" style="white-space:pre">        </span>client.send('/exchange/capacity/nothing.special', {}, data);</div><div>
};</div><div><br></div><div>var handleMessage = function(d) {</div><div><span class="" style="white-space:pre">        </span>$("#messages").append(d.body + "\n");</div><div>};</div><div><br></div><div>var on_error = function(error) {</div>
<div><span class="" style="white-space:pre">        </span>console.log(error);</div><div>};</div><div><br></div><div>client.connect('user', 'pass', on_connect, on_error, '/');</div></div><div><br></div><div>
Br,</div><div>Petri</div></div><div class="gmail_extra"><br clear="all"><div>Petri Luojus<br>+358 41 437 3592<br>Oulu, Finland<br><a href="mailto:luojus@gmail.com" target="_blank">luojus@gmail.com</a><br><br></div>
<br><br><div class="gmail_quote">On Fri, Oct 18, 2013 at 1:43 PM, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
Hi,<br>
<br>
On 11/10/13 07:58, Petri Luojus wrote:<br>
<br>
</div>> GET /stomp/websocket HTTP/1.1<br>
> Upgrade: websocket<br>
> Connection: Upgrade<br>
> Host: xxx.yyy:15674<br>
> Origin: null<br>
> Sec-WebSocket-Protocol: v10.stomp, v11.stomp<br>
> Pragma: no-cache<br>
> Cache-Control: no-cache<br>
> Sec-WebSocket-Key: YRpCwsRP6s2ounZHK4soEQ==<br>
> Sec-WebSocket-Version: 13<br>
> Sec-WebSocket-Extensions: x-webkit-deflate-frame<br>
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36<br>
> (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36<br>
> Cookie: auth=bHVvanVzOk15aGthbGU1;<br>
> 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<br>
><br>
> HTTP/1.1 101 Switching Protocols<br>
> Upgrade: websocket<br>
> Sec-Websocket-Accept: DGeZKxS98lD43p+4Gkhb17W29E0=<br>
> Connection: Upgrade<br>
<br>
Can you confirm what the code you used to generate these headers, and<br>
which revision of stomp.js? I get slightly different headers and no<br>
error when I use the latest version of Chrome and the web stomp examples<br>
that ship in<br>
<br>
<a href="http://hg.rabbitmq.com/rabbitmq-web-stomp-examples/" target="_blank">http://hg.rabbitmq.com/rabbitmq-web-stomp-examples/</a><br>
<br>
<br>
GET ws://localhost:15674/stomp/584/zw7on1yc/websocket HTTP/1.1<br>
Pragma: no-cache<br>
Origin: <a href="http://localhost:15670" target="_blank">http://localhost:15670</a><br>
Host: localhost:15674<br>
Sec-WebSocket-Key: VE4morwMfRKFtxmcVUdddQ==<br>
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,<br>
like Gecko) Chrome/30.0.1599.101 Safari/537.36<br>
Upgrade: websocket<br>
Sec-WebSocket-Extensions: x-webkit-deflate-frame<br>
Cache-Control: no-cache<br>
Connection: Upgrade<br>
Sec-WebSocket-Version: 13<br>
<br>
HTTP/1.1 101 Switching Protocols<br>
Connection: Upgrade<br>
Sec-Websocket-Accept: x4EO4xRPJ3Cc9kzEnvlv2ToCSvc=<br>
Upgrade: websocket<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
<br>
-Emile<br>
<br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div>