2012-05-06, 11:34
When using Firefox, I can't get the websocket.org demo to connect to the websocket. In Chrome I can.
Via the demo I found out I had to send the JSON encoded string instead of the actual object (I tried this before using the Introspect method, but this gave me the error "Received unexpected continuation frame."):
This does work!
BTW: The error "Received unexpected continuation frame." also occurs when I start playing a movie.
Via the demo I found out I had to send the JSON encoded string instead of the actual object (I tried this before using the Introspect method, but this gave me the error "Received unexpected continuation frame."):
Code:
var xbmcSocket = new WebSocket('ws://localhost:9090/jsonrpc');
xbmcSocket.onopen = function() {
console.log('xbmcSocket.open');
xbmcSocket.send(JSON.stringify({
"id": 1,
"jsonrpc": "2.0",
"method": "JSONRPC.Ping"
}));
};
xbmcSocket.onmessage = function(msg) {
console.log('xbmcSocket.onmessage', msg);
};
This does work!
BTW: The error "Received unexpected continuation frame." also occurs when I start playing a movie.