Created
May 16, 2025 11:04
-
-
Save nenkoru/d6b31355150792087c26b8fc9296632b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Screen Capture Client</title> | |
| </head> | |
| <body> | |
| <img id="screen" alt="Screen capture" /> | |
| <script> | |
| const img = document.getElementById('screen'); | |
| //const ws = new WebSocket('ws://localhost:8080/ws'); | |
| const ws = new WebSocket('ws://172.29.71.57:8080/ws'); | |
| ws.onmessage = (event) => { | |
| const blob = new Blob([event.data], { type: 'image/jpeg' }); | |
| img.src = URL.createObjectURL(blob); | |
| }; | |
| ws.onclose = () => { | |
| console.log('WebSocket connection closed'); | |
| }; | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment