-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
21 lines (20 loc) · 810 Bytes
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask-SocketIO Client</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.1.2/socket.io.js" integrity="sha384-EwQIfJBLgjys3w8Xb8ZDPYtJkmA8CyUD4f88N4CgEMhuMquuOmxX5iC6QloS4h9W" crossorigin="anonymous"></script>
<script type="text/javascript">
var socket = io.connect('http://' + document.domain + ':' + location.port);
function sendMessage() {
var message = document.getElementById('message_input').value;
socket.emit('message', message);
}
</script>
</head>
<body>
<input type="text" id="message_input" />
<button onclick="sendMessage()">Send</button>
</body>
</html>