forked from WistfulHopes/GGXXACPR_Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwsTestACPR.html
More file actions
30 lines (30 loc) · 806 Bytes
/
Copy pathwsTestACPR.html
File metadata and controls
30 lines (30 loc) · 806 Bytes
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
29
30
<!DOCTYPE html>
<html lang="en">
<head>
<script>
//const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
let webSocket = new WebSocket('ws://127.0.0.1:52615/');
webSocket.onopen = function(e) {
console.log("Connected to ACPR WS");
let dateTime = Date.now();
console.log("Unix time is now: "+dateTime);
webSocket.send(dateTime);
}
webSocket.onmessage = function(e) {
console.log("WS recieved: "+e.data);
}
webSocket.onerror = function(e) {
console.log("WS error: "+e);
webSocket.close();
}
//getData();
//async function getData() {
//while (true) {
//webSocket.send("data");
//console.log("sending data");
//await sleep(1000/16);
//}
//}
</script>
</head>
</html>