| <?xml version = "1.0" encoding="utf-8" ?>
|
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
| See COPYING for copyright and distribution information.
|
| <html xmlns = "http://www.w3.org/1999/xhtml">
|
| <title>Test WebSocket Support</title>
|
| <script type="text/javascript">
|
| if ('WebSocket' in window) {
|
| output += "This browser support WebSocket.";
|
| output += "No WebSocket support.";
|
| document.getElementById('result').innerHTML += output;
|
| console.log("starting websocket...");
|
| if ("WebSocket" in window) {
|
| var ws = new WebSocket("ws://localhost:9696");
|
| console.log("WebSockets connection opened");
|
| ws.send("Hello Server (from client).");
|
| ws.onmessage = function(e) {
|
| console.log("Got from server: " + e.data);
|
| ws.onclose = function() {
|
| console.log("WebSockets connection closed");
|
| alert("No WebSockets support");
|
| <button onclick="test()">Test Now!</button>
|
| <p id="result">Result here: </p>
|