Commit 5e8af30d authored by Sam Rushing's avatar Sam Rushing

compute websocket uri

parent b8574cbd
var connection;
var msgs_div = document.getElementById ('msgs')
var draw_cmds = [];
var host = "127.0.0.1";
var port = "9001";
function message (msg) {
msgs_div.innerHTML = msg;
}
if (window["WebSocket"]) {
connection = new WebSocket("ws://" + host + ":" + port + "/field")
var loc = window.location, new_uri;
if (loc.protocol === "https:") {
ws_uri = "wss:";
} else {
ws_uri = "ws:";
}
ws_uri += "//" + loc.host;
connection = new WebSocket(ws_uri + "/field");
connection.onopen = function () {
message ('connected')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment