(function(){function n(n){e.innerHTML+="<span>"+n+"<\/span><br/>"}var u=location.protocol==="https:"?"wss:":"ws:",f=u+"//"+location.host+"/ws",t=new WebSocket(f),e=document.getElementById("log"),r,i;t.onopen=function(){n("Connected.")};t.onclose=function(t){t.wasClean?n("Disconnected."):n("Connection lost.");n("Code: "+t.code+". Reason: "+t.reason)};t.onmessage=function(t){n(":> "+t.data)};t.onerror=function(t){n("Error: "+t.message)};r=document.getElementById("form");i=document.getElementById("message");r.onsubmit=function(){return t.send(i.value),i.value="",!1}})();