-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
36 lines (32 loc) · 1.04 KB
/
index.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
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<title>Howick Sync</title>
</head>
<body>
<div id="log-container">
<!-- Log updates will be displayed here -->
</div>
<script>
const logContainer = document.getElementById('log-container');
// Create a WebSocket connection to your server
const socket = new WebSocket('ws://localhost:3003');
// WebSocket event handlers
socket.onopen = (event) => {
logContainer.innerHTML = 'WebSocket connection is open.';
};
socket.onmessage = (event) => {
// Handle updates received from the WebSocket server
const data = JSON.parse(event.data);
// Assuming you want to display the log updates in a div
logContainer.innerHTML = JSON.stringify(data, null, 2);
};
socket.onerror = (error) => {
console.error('WebSocket error:', error);
};
socket.onclose = () => {
console.log('WebSocket connection closed');
};
</script>
</body>
</html>