MozWebSocket

614 views
Skip to first unread message

codehugger

unread,
Jul 11, 2011, 9:49:13 AM7/11/11
to Tornado Web Server
Hi

I have written a very simple chat application that delegates messages
to/from RabbitMQ. The client is very thin and only connects to a
WebSocketHandler and to connect to a chat channel sends a single JSON
request. The problem I am encountering is that this all works fine in
Chrome using WebSocket but when I try to do the same in Firefox using
MozWebSocket it closes the connection immediately:

var updater = {
// the Chrome connection
//updater.socket = new WebSocket("ws://10.20.103.229:8888/
chatsocket");

// the FireFox connection
updater.socket = new MozWebSocket("ws://10.20.103.229:8888/
chatsocket");

updater.socket.onmessage = function(event) {
console.log(event.data);
if (event.data == 'Queue Declared') {
this.send(JSON.stringify(
{"exc": "EX_midgardur",
"key": "foo"}
));
}
};
};

any help would be much appreciated.

codehugger

Ben Darnell

unread,
Jul 11, 2011, 10:47:40 PM7/11/11
to python-...@googlegroups.com
The websocket protocol is still in development.  Tornado and chrome (and safari) implement the "draft 76" version of the protocol, while firefox only supports one of the newer drafts.  Unfortunately if you need cross-browser compatibility, websockets aren't quite there yet and you're better off sticking with long polling for now.


-Ben

vene4ka

unread,
Jul 12, 2011, 4:11:30 AM7/12/11
to Tornado Web Server
Try TornadIO - the implementation of the Socket.IO realtime transport
library on top of the Tornado framework.
https://github.com/MrJoes/tornadio/
Reply all
Reply to author
Forward
0 new messages