web socket using tornado

This commit is contained in:
ori agranat
2019-03-01 21:59:49 +02:00
parent 366466260c
commit 05305393a9
9 changed files with 29 additions and 35 deletions

View File

@@ -15,5 +15,14 @@
<a class="nav-link" href="#">3D</a>
</nav>
</div>
<script>
var ws = new WebSocket("ws://localhost:8888/websocket");
ws.onopen = function () {
ws.send("hello");
}
ws.onmessage = function (ev) {
alert(ev.data);
}
</script>
</body>
</html>