
var ProtoBuf = dcodeIO.ProtoBuf;
var Builder = ProtoBuf.loadProtoFile("proto/ClientMessage.proto");
ProtoBuf.loadProtoFile("proto/Login.proto", Builder);



var Message = Builder.build("msg");
var ClientMessage = Message.ClientMessage;
var LoginMessage = Message.Login;

var loginMsg = new LoginMessage("integr@gmail.com","secret");
var clientMsg = new ClientMessage({
    "msgType" : "LoginType",
    "login":{
 "email":"integr@gmail.com", "password":"secret"}});




var ws;
window.onload=function(){
  ws=new WebSocket("ws://localhost:8080/index");


    
  ws.onmessage = function(evt) {
      console.log(evt.data);
      var loginFormSection = document.getElementById("loginFormSection");
      if(evt.data == "AUTHPLS") {
	  loginFormSection.style.display = "block";
	  }
      if(evt.data == "AUTHOKTHX") {
loginFormSection.style.display = "none";
document.getElementById("portal").style.display = "block";
}
  };

  ws.onopen=function(evt){
//    ws.send("Hello");
      ws.send(clientMsg.toArrayBuffer());
  };
};

window.onclose=function(){
  ws.close();
};

function loginSubmitEvent () {
    var email = document.getElementById("loginEmail").value;
    var password = document.getElementById("loginPassword").value;
    ws.send(email + ":" + password);
}


@@ -964,24 +964,58 @@
 d(%22Hello%22);%0A
+      for(i = 0; i %3C 1000; i++) %7B%0A
       ws.sen
@@ -1044,16 +1044,21 @@
 fer());%0A
+%09  %7D%0A
   %7D;%0A%7D;%0A

Send 1k messages on startup for testing.