33 lines
No EOL
855 B
HTML
33 lines
No EOL
855 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Wormhole test</title>
|
|
|
|
<script>
|
|
let theFunniestStringEver = '';
|
|
for (let i = 0; i < 1000000; i++) {
|
|
theFunniestStringEver += 'h';
|
|
}
|
|
|
|
// Create WebSocket connection.
|
|
const socket = new WebSocket('ws://localhost:8080/hello');
|
|
|
|
// Connection opened
|
|
socket.addEventListener('open', function (event) {
|
|
socket.send(theFunniestStringEver);
|
|
});
|
|
|
|
socket.addEventListener('error', console.error)
|
|
|
|
// Listen for messages
|
|
socket.addEventListener('message', function (event) {
|
|
console.log('Message from server ', event.data);
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
</body>
|
|
</html> |