comparison mod_websocket/websocket.html @ 1398:24f6540c1eaf

mod_websocket: Update websocket.html
author Florian Zeitz <florob@babelmonkeys.de>
date Mon, 28 Apr 2014 23:24:01 +0200
parents 14e10bce7463
children
comparison
equal deleted inserted replaced
1397:4e36b68d68da 1398:24f6540c1eaf
4 <title>XMPP Websocket</title> 4 <title>XMPP Websocket</title>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 if ("WebSocket" in window) { 6 if ("WebSocket" in window) {
7 var ws = new WebSocket("ws://localhost:5280/xmpp-websocket/", "xmpp"); 7 var ws = new WebSocket("ws://localhost:5280/xmpp-websocket/", "xmpp");
8 ws.onopen = function() { 8 ws.onopen = function() {
9 ws.send("<stream:stream to='localhost' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"); 9 ws.send("<open to='localhost' xmlns='urn:ietf:params:xml:ns:xmpp-framing' version='1.0'/>");
10 }; 10 };
11 ws.onmessage = function (evt) { 11 ws.onmessage = function (evt) {
12 var message = evt.data; 12 var message = evt.data;
13 alert ("Received frame: " + message); 13 alert ("Received frame: " + message);
14 }; 14 };