30 lines
913 B
HTML
30 lines
913 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>WebSocket Test</title>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
// Replace 'ws://localhost/ws' with your WebSocket server address
|
|
var ws = new WebSocket('ws://'+window.location.host+':1025/ws');
|
|
|
|
ws.onopen = function() {
|
|
console.log('WebSocket connection established');
|
|
};
|
|
|
|
ws.onmessage = function(event) {
|
|
console.log('Message received: ' + event.data);
|
|
};
|
|
|
|
ws.onclose = function() {
|
|
console.log('WebSocket connection closed');
|
|
};
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>WebSocket Test Page</h1>
|
|
</body>
|
|
</html>
|