Permalink
Browse files

Added close code reporting to test page

  • Loading branch information...
mloughran committed Feb 12, 2013
1 parent b095853 commit d1b4cc0e8c4526f0f52b60ff1bf103a85fde1233
Showing with 3 additions and 1 deletion.
  1. +3 −1 examples/test.html
View
@@ -12,7 +12,9 @@
var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
var ws = new Socket("ws://localhost:8080/foo/bar?hello=world");
ws.onmessage = function(evt) { debug("Received: " + evt.data); };
- ws.onclose = function() { debug("socket closed"); };
+ ws.onclose = function(event) {
+ debug("Closed - code: " + event.code + ", reason: " + event.reason + ", wasClean: " + event.wasClean);
+ };
ws.onopen = function() {
debug("connected...");
ws.send("hello server");

0 comments on commit d1b4cc0

Please sign in to comment.