diff webtty.js @ 10:d051aad3e95f

webtty: begin experimenting with JSON protocol.
author John "Elwin" Edwards <elwin@sdf.org>
date Wed, 09 May 2012 16:36:11 -0700
parents 826a7ced69f8
children 481dcee353c9
line wrap: on
line diff
--- a/webtty.js	Wed May 09 13:38:05 2012 -0700
+++ b/webtty.js	Wed May 09 16:36:11 2012 -0700
@@ -182,7 +182,8 @@
   var nsession = new TermSession(sessid, h, w);
   resheaders["Set-Cookie"] = "ID=" + sessid;
   res.writeHead(200, resheaders);
-  res.write("l1\n" + sessid + "\n" + String(h) + "x" + String(w) + "\n");
+  var logindict = {"login": true, "id": sessid, "w": w, "h": h};
+  res.write(JSON.stringify(logindict));
   res.end();
   console.log("Started new session with key " + sessid + ", pid " + nsession.child.pid);
   return;