Clean up JavaScript example in WebSocket client
This commit is contained in:
parent
2c62e93fb4
commit
8234e4bd91
1 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue