author | Kim Alvefur <zash@zash.se> |
Tue, 16 Sep 2014 19:53:41 +0200 | |
changeset 1506 | a40f9b8661d8 |
parent 1398 | 24f6540c1eaf |
permissions | -rw-r--r-- |
129 | 1 |
<!DOCTYPE html> |
2 |
<html> |
|
3 |
<head> |
|
4 |
<title>XMPP Websocket</title> |
|
5 |
<script type="text/javascript"> |
|
6 |
if ("WebSocket" in window) { |
|
848
14e10bce7463
mod_websocket: Update example HTML
Florian Zeitz <florob@babelmonkeys.de>
parents:
129
diff
changeset
|
7 |
var ws = new WebSocket("ws://localhost:5280/xmpp-websocket/", "xmpp"); |
129 | 8 |
ws.onopen = function() { |
1398
24f6540c1eaf
mod_websocket: Update websocket.html
Florian Zeitz <florob@babelmonkeys.de>
parents:
848
diff
changeset
|
9 |
ws.send("<open to='localhost' xmlns='urn:ietf:params:xml:ns:xmpp-framing' version='1.0'/>"); |
129 | 10 |
}; |
11 |
ws.onmessage = function (evt) { |
|
12 |
var message = evt.data; |
|
13 |
alert ("Received frame: " + message); |
|
14 |
}; |
|
15 |
ws.onclose = function() { |
|
16 |
alert ("Disconnected"); |
|
17 |
}; |
|
18 |
} else { |
|
19 |
alert ("Your browser doesn't implement WebSocket !"); |
|
20 |
} |
|
21 |
</script> |
|
22 |
</head> |
|
23 |
<body> |
|
24 |
</body> |
|
25 |
</html> |