Created
September 8, 2022 13:47
-
-
Save nickcharlton/43fa8eef090f3bca37d99b84ebe145d6 to your computer and use it in GitHub Desktop.
A basic Web Sockets client demo
This file contains 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
<html> | |
<head> | |
<script> | |
const webSocket = new WebSocket("ws://localhost:4283/ws"); | |
webSocket.onmessage = (event) => { | |
console.log(event.data); | |
} | |
window.webSocket = webSocket; | |
</script> | |
</head> | |
<body> | |
<h1>Web Sockets Demo</h1> | |
<div id="output"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment