webshit
This commit is contained in:
parent
632ece25c9
commit
6669e0ce77
|
@ -1,6 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>WebSocket</title>
|
||||
<style>
|
||||
body {
|
||||
display: grid;
|
||||
|
@ -125,6 +127,24 @@
|
|||
<div class="tabs"></div>
|
||||
<div class="result"></div>
|
||||
</section>
|
||||
<footer class="footer"></footer>
|
||||
<footer class="footer">
|
||||
<p id="console"></p>
|
||||
</footer>
|
||||
<script>
|
||||
const loc = window.location;
|
||||
const proto = loc.protocol === "https:" ? "wss:" : "ws:"
|
||||
const ws = new WebSocket(proto + "//" + loc.host + "/ws")
|
||||
|
||||
ws.onopen = function() {
|
||||
console.log("Connected")
|
||||
}
|
||||
|
||||
ws.onmessage = function(evt) {
|
||||
const out = document.getElementById("console");
|
||||
out.innerHTML += evt.data + "<br>";
|
||||
// TODO: react on MPD communication here
|
||||
// TODO: react on yt-dlp communication here
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue