-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
32 lines (30 loc) · 831 Bytes
/
index.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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>FlashSocket example</title>
<script src="swfobject.js"></script>
<script src="flashsocket.js"></script>
<script>
// FlashSocket settings
// Force using FlashSocket over native WebSocket. default false
FlashSocket.forceFlash = true;
// URL for flashsocket.swf location. default 'flashsocket.swf'
FlashSocket.swfUrl = 'flashsocket.swf';
// Enable Debugging. default false
FlashSocket.debug = false;
var socket = new FlashSocket("ws://localhost:8080/websocket");
socket.onopen = function (e) {
console.log("Socket opened");
socket.send("hello world");
};
socket.onmessage = function (e) {
console.log("Recieved message: " + e.data);
socket.close();
};
socket.onclose = function (e) {
console.log("Socket closed");
};
</script>
</head>
</html>