Commit cce2bb55 authored by ibuler's avatar ibuler

bug

parent a01c1a40
...@@ -3,17 +3,18 @@ ...@@ -3,17 +3,18 @@
<title>WebSocket Test</title> <title>WebSocket Test</title>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
// <!--var wsUri = "ws://172.10.10.9/echo/"; --> // <!--var wsUri = "ws://172.10.10.9/echo/"; -->
var ws = "ws://echo.websocket.org/"; var wsUri = "ws://echo.websocket.org/";
var output; var output;
function init() { function init() {
output = document.getElementById("output"); testWebSocket(); } output = document.getElementById("output"); testWebSocket(); }
function testWebSocket() { function testWebSocket() {
websocket = new WebSocket(ws); websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) }; websocket.onopen = function(evt) { onOpen(evt) };
websocket.onclose = function(evt) { onClose(evt) }; websocket.onclose = function(evt) { onClose(evt) };
websocket.onmessage = function(evt) { onMessage(evt) }; websocket.onmessage = function(evt) { onMessage(evt) };
websocket.onerror = function(evt) { onError(evt) }; } websocket.onerror = function(evt) { onError(evt) };
} }
function onOpen(evt) { function onOpen(evt) {
writeToScreen("CONNECTED"); doSend("WebSocket rocks sssssssssssssssssssssssssss"); } writeToScreen("CONNECTED"); doSend("WebSocket rocks sssssssssssssssssssssssssss"); }
function onClose(evt) { writeToScreen("DISCONNECTED"); } function onClose(evt) { writeToScreen("DISCONNECTED"); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment