Mercurial > hg > rlgwebd
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 9:826a7ced69f8 | 10:d051aad3e95f |
|---|---|
| 180 h = t; | 180 h = t; |
| 181 } | 181 } |
| 182 var nsession = new TermSession(sessid, h, w); | 182 var nsession = new TermSession(sessid, h, w); |
| 183 resheaders["Set-Cookie"] = "ID=" + sessid; | 183 resheaders["Set-Cookie"] = "ID=" + sessid; |
| 184 res.writeHead(200, resheaders); | 184 res.writeHead(200, resheaders); |
| 185 res.write("l1\n" + sessid + "\n" + String(h) + "x" + String(w) + "\n"); | 185 var logindict = {"login": true, "id": sessid, "w": w, "h": h}; |
| 186 res.write(JSON.stringify(logindict)); | |
| 186 res.end(); | 187 res.end(); |
| 187 console.log("Started new session with key " + sessid + ", pid " + nsession.child.pid); | 188 console.log("Started new session with key " + sessid + ", pid " + nsession.child.pid); |
| 188 return; | 189 return; |
| 189 } | 190 } |
| 190 | 191 |
