Chrome does not support wamp.2.json sub protocol?

555 views
Skip to first unread message

Mike Lee

unread,
Jun 24, 2014, 10:39:35 PM6/24/14
to wam...@googlegroups.com
Hi I am using wampy.js on the client side, server side is ratchet php server.
I am trying the basic wamp samples mentioned on ratchet site, with wampy.js on the client side, it works in firefox (I have version 30.0 installed), however it doesn't work on Chrome (Version 35.0.1916.153 m, latest version).
This is the error:

WebSocket connection to 'ws://192.168.1.70:8080/ws' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

I debugged into the code, the problem is the sub-protocol.

So I am trying a simple js connection. the follow works:

 var conn = new WebSocket("ws://192.168.1.70:8080/ws","wamp");

 var conn = new WebSocket("ws://192.168.1.70:8080/ws");

but the following will throw above error in Chrome:

 var conn = new WebSocket("ws://192.168.1.70:8080/ws","wamp.2.json");
 var conn = new WebSocket("ws://192.168.1.70:8080/ws","wamp.2.msgpack");

So can anyone confirm that wamp2.0 is NOT supported in Chrome?  If it is true, can I force wampy.js to use wamp v1?

thanks

Bas Wegh

unread,
Jun 25, 2014, 2:31:05 AM6/25/14
to wam...@googlegroups.com
Hello,

The Error tells you that during the handshake the client sent a sub-protocol request which was not empty, yet the server did not respond with one,
so the handshake is not correct.
Firefox does accept such dirty handshakes, yet chrome seems not to.

The error is at the router side, not the client.


WebSocket connection to 'ws://192.168.1.70:8080/ws' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

cheers,
Bas
 

Mike Lee

unread,
Jun 25, 2014, 5:11:35 AM6/25/14
to wam...@googlegroups.com
Thanks.  I guess Ratchet doesn't support wamp2?

Konstantin Burkalev

unread,
Jun 25, 2014, 6:55:59 AM6/25/14
to wam...@googlegroups.com
Hi, Mike!

I'm glad, that you use wimpy.js :)

On your questions:
  • Ratchet php server currently doesn't support WAMP v2 protocol, only v1. There is a related PR https://github.com/ratchetphp/Ratchet/pull/193 
  • Wampy.js supports WAMP v1 only in v0.1.0 release. Beginning from v1.0.0 only WAMP v2 is supported.
  • WAMP version 2 has no backward compatibility with version 1
  • Wampy.js > v1.0.0 supports only WAMP version 2 
  • And as Bas has already told you, Websocket protocol handshake expects server subprotocol specification if client has specified it in request

Reply all
Reply to author
Forward
0 new messages