1 <!DOCTYPE html> 2 <html> 3 <!-- 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. 5 Use of this source code is governed by a BSD-style license that can be 6 found in the LICENSE file. 7 --> 8 <head> 9 <meta http-equiv="Pragma" content="no-cache"> 10 <meta http-equiv="Expires" content="-1"> 11 <title>{{title}}</title> 12 <script type="text/javascript" src="common.js"></script> 13 <script type="text/javascript" src="example.js"></script> 14 </head> 15 <body {{attrs}}> 16 <h1>{{title}}</h1> 17 <h2>Status: <code id="statusField">NO-STATUS</code></h2> 18 <p>The Websocket example demonstrates how to use the Websocket API.<br> 19 First set a server URL (or use the default), then push "Connect" button to 20 establish a connection.<br> 21 "Send" button sends text message on the left text area.<br> 22 "Close" button closes the connection. 23 </p> 24 <form id="connectForm"> 25 <input type="text" id="url" style="width: 400px" 26 value="ws://html5rocks.websocket.org/echo"> 27 <input type="submit" value="Connect"> 28 </form> 29 30 <form id="sendForm"> 31 <input type="text" id="message" value="hello" style="width: 400px"> 32 <input type="submit" value="Send"> 33 <input type="checkbox" id="is_binary">as a binary message 34 </form> 35 36 <button id="closeButton">Close</button> 37 <pre id="log" style="font-weight: bold"></pre> 38 <div id="listener"></div> 39 </body> 40 </html> 41