Sha256: 4c55c3cbee86cf4a73eaf1179453d873f124d146a85bd4e386c298caae77385e
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta content="text/css" http-equiv="content-style-type" /> <meta content="text/javascript" http-equiv="content-script-type" /> <script type="text/javascript" src='js/jquery.min.js'></script> <script type="text/javascript" src='js/swfobject.js'></script> <script type="text/javascript" src='js/FABridge.js'></script> <script type="text/javascript" src='js/web_socket.js'></script> <script type="text/javascript" src='js/json2.js'></script> <link rel="stylesheet" type="text/css" href="echo.css" /> <title>Cool.io-WebSocket Demo: Echo server</title> <script> WS_URL = "ws://localhost:8081"; WEB_SOCKET_SWF_LOCATION = "js/WebSocketMain.swf"; var global = this; $(document).ready(function(){ function debug(message) { html = "<p><span class='time'>"+new Date()+"</span>"+message+"</p>" $("#debug").append(html); } debug("connecting to "+WS_URL+"..."); ws = new WebSocket(WS_URL); ws.onopen = function() { debug("connected."); text = "client: hello"; ws.send(text); debug("message sent: "+text); } ws.onclose = function() { debug("disconnected..."); } ws.onerror = function(msg) { debug("failed to connect:"+msg); } ws.onmessage = function(event) { debug("message received: "+event.data); $("#message").append("<p>"+event.data+"</p>"); } setTimeout(function(){ws.send('YOYOYOYOYO')}, 5000); }); </script> </head> <body> <div id="message"></div> <div id="debug"></div> </body>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cool.io-websocket-0.1.4 | examples/public/echo.html |