Clean up JavaScript example in WebSocket client

This commit is contained in:
Adrian Pacała 2015-07-25 08:09:18 +02:00 committed by Griatch
parent 2c62e93fb4
commit 8234e4bd91

View file

@ -19,12 +19,12 @@ plain text (command input).
Example of call from a javascript client: Example of call from a javascript client:
websocket = new WeSocket("ws://localhost:8021") var websocket = new WebSocket("ws://localhost:8021");
var msg1 = "WebSocket Test" var msg1 = "WebSocket Test";
websocket.send(msg1) websocket.send(msg1);
var msg2 = JSON.stringify({"testfunc":[[1,2,3], {"kwarg":"val"}]}) var msg2 = JSON.stringify({ testfunc: [[1, 2, 3], { kwarg: "val" }] });
websocket.send("OOB" + msg2) websocket.send("OOB" + msg2);
websocket.close() websocket.close();
""" """
import json import json