annotate mod_websocket/websocket.html @ 1460:5e1f7af23cf0

mod_register_web: Add dependency on mod_http
author Kim Alvefur <zash@zash.se>
date Fri, 27 Jun 2014 22:48:15 +0200
parents 24f6540c1eaf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
1 <!DOCTYPE html>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
2 <html>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
3 <head>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
4 <title>XMPP Websocket</title>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
5 <script type="text/javascript">
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
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
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
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
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
10 };
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
11 ws.onmessage = function (evt) {
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
12 var message = evt.data;
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
13 alert ("Received frame: " + message);
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
14 };
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
15 ws.onclose = function() {
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
16 alert ("Disconnected");
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
17 };
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
18 } else {
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
19 alert ("Your browser doesn't implement WebSocket !");
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
20 }
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
21 </script>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
22 </head>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
23 <body>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
24 </body>
5fc00a3e47b5 mod_websocket: Initial commit
Ali Sabil <ali.sabil@gmail.com>
parents:
diff changeset
25 </html>