-
Notifications
You must be signed in to change notification settings - Fork 0
/
testws.html
36 lines (26 loc) · 1.02 KB
/
testws.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebSocket Echo Client</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/node-uuid/1.4.8/uuid.min.js"></script>
<script src="main.js"></script>
<h1>WebSocket Echo Client</h1>
<p>
<input id="server" type="text" value="ws://echo.websocket.org/" size="40">
<button onclick="manageConnection(document.getElementById('server').value,'connect')">Open</button>
<button onclick="manageConnection(document.getElementById('server').value,'disconnect')">Close</button>
</p>
<p>
<input id="message" type="text" size="40">
<button onclick="postMessageToWSServer(document.getElementById('message').value,'txt')">Send Text</button>
<button onclick="postMessageToWSServer(document.getElementById('message').value,'bin')">Send Binary</button>
</p>
<p>Use hexadecimal to send binary messages...</p>
<ul id="messages"></ul>
<script>
</script>
</body>
</html>