nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.83k stars 304 forks source link

Google Chrome 14/15 websocket not supported #35

Closed PhE closed 12 years ago

PhE commented 12 years ago

The following javascript works fine on my Google Chrome 12 and Chromium 13 (Ubuntu 64bits). It fails with Chrome 14 and Chrome 15 : the onopen() callback is never triggered.

    function testJSON() {
        jsonSocket = new WebSocket("ws://127.0.0.1:7379/.json");
        jsonSocket.onopen = function() {
            console.log("JSON socket connected!");
            jsonSocket.send(JSON.stringify(["SET", "hello", "world"]))
            jsonSocket.send(JSON.stringify(["GET", "hello"]))
        }
        jsonSocket.onmessage = function(messageEvent) {
            console.log("JSON received:", messageEvent.data)
        }        
    }
    testJSON();  
nicolasff commented 12 years ago

WebSocket support has been updated to use RFC 6455, the official protocol spec. It is still experimental and disabled by default, but the demo in tests/websocket.html now works with Chrome 17 and Firefox 8. I will not add backward-compatibility for older versions of the WebSocket protocol, the RFC is the final specification.