summaryrefslogtreecommitdiff
path: root/test.html
blob: c8dc987fd31d508bb64e4d1fa6273a2074b95296 (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);
         };
         ws.onopen = function() {
             console.log("connected");
             ws.send("Hello, there!");
         }
         ws.onclose = function() {
             console.log("closed websocket");
         }
        </script>
    </body>
</html>