This commit is contained in:
@@ -18,13 +18,13 @@
|
||||
</body>
|
||||
|
||||
<script>
|
||||
const ws = new WebSocket('ws://' + window.location.host + '/ws');
|
||||
const webSocket = new WebSocket('webSocket://' + window.location.host + '/webSocket');
|
||||
|
||||
ws.onopen = function() {
|
||||
webSocket.onopen = function() {
|
||||
console.log('WebSocket connection opened.');
|
||||
};
|
||||
|
||||
ws.onmessage = function(event) {
|
||||
webSocket.onmessage = function(event) {
|
||||
console.log('Progress:', event.data);
|
||||
// Update the progress bar
|
||||
let progress = parseInt(event.data);
|
||||
@@ -48,11 +48,11 @@
|
||||
|
||||
};
|
||||
|
||||
ws.onerror = function(error) {
|
||||
webSocket.onerror = function(error) {
|
||||
console.error('WebSocket error:', error);
|
||||
};
|
||||
|
||||
ws.onclose = function() {
|
||||
webSocket.onclose = function() {
|
||||
console.log('WebSocket connection closed.');
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user