summaryrefslogtreecommitdiff
path: root/test.html
blob: 23f7524c084d28c22eb0b5c707e15e25379b06cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
    <body>
        <script type="text/javascript">
         var ws = new WebSocket("ws://localhost:9090");
         console.log("initialized websocket");
         ws.onmessage = function(evt) {
             console.log("received message");
             console.log(evt.data);
         };
         ws.onopen = function() {
             console.log("connected");
             ws.send("Hello, there!");
         }
         ws.onclose = function() {
             console.log("closed websocket");
         }
        </script>
    </body>
</html>