|
|
@ -18,7 +18,11 @@
|
|
|
|
).innerHTML += `<span style="color: ${color}">${text}</span><br>`;
|
|
|
|
).innerHTML += `<span style="color: ${color}">${text}</span><br>`;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const socket = new WebSocket("wss://" + location.host + "/echo/");
|
|
|
|
const socket = new WebSocket(
|
|
|
|
|
|
|
|
location.protocol == "https"
|
|
|
|
|
|
|
|
? "wss://"
|
|
|
|
|
|
|
|
: "ws://" + location.host + location.pathname + "/echo/"
|
|
|
|
|
|
|
|
);
|
|
|
|
socket.addEventListener("message", (ev) => {
|
|
|
|
socket.addEventListener("message", (ev) => {
|
|
|
|
log("<<< " + ev.data, "blue");
|
|
|
|
log("<<< " + ev.data, "blue");
|
|
|
|
});
|
|
|
|
});
|
|
|
|