I'm using python socket to communicate with JavaScript clients.
http://docs.python.org/2/library/socket.html
And following the part of JavaScript code,
ws = new WebSocket("ws://localhost:7777/");
ws.onopen = function(){
alert("websocket opened.");
}
ws.onclose = function(){
alert("websocket closed.");
}
ws.onmessage = function(e) {
alert(e.data);
}
I need to pass a json or a string from the python socket to the JavaScript. Still cant find a way to pass a json. Not any encoding mechanism support for that.