-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat.html
28 lines (27 loc) · 859 Bytes
/
chat.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Univer Server</title>
</head>
<body>
<script>
var ws = new WebSocket("ws://localhost:8448/ws");
//Triggered when the connection is opened
ws.onopen = function(evt) {
console.log("Connection open...");
ws.send("Hello WebSockets!");
};
//Triggered when a message is received
ws.onmessage = function(evt) {
console.log("Received Message: " + evt.data);
};
//Triggered when the connection is closed
ws.onclose = function(evt) {
console.log("Connection closed.");
};
</script>
</body>
</html>