You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Are you using 1v51 of Espruino? That had some changes that really improved stability. I've also done a few more tweaks that'll appear in 1v52 and that should improve matters fuirther.

    Also are you sure you're connecting to VBat and not 3.3v, as the 3.3v regulator won't supply enough power for the CC3000...

    As far as the request headers, they're pre-parsed in req.headers / res.headers:

    >require("http").createServer(function (req, res) {
    :  console.log(req.headers);   
    :  res.writeHead(200, {'Content-Type': 'text/plain'});
    :  res.end();
    :}).listen(8081);  
    ...
    {"Host":"localhost:8081",
     "Connection":"keep-alive",
     "Accept":"text/html,application/xhtml+xm­l,application/xml;q=0.9,image/webp,*/*;q­=0.8",
     "User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
     "Accept-Encoding":"gzip,deflate,sdch",
     "Accept-Language":"en-GB,en-US;q=0.8,en;­q=0.6"}
    

    and

    >require("http").get("http://www.pur3.co­.uk/time.php", function(res) {
    :  console.log(res.headers);   
    :});                                                  
    ...
    {"Date":"Thu, 20 Feb 2014 16:25:35 GMT",
     "Server":"Apache/2.2.14 (Ubuntu)",
     "X-Powered-By":"PHP/5.3.2-1ubuntu4.18",
     "Vary":"Accept-Encoding",
     "Content-Length":"8",
     "Connection":"close",
     "Content-Type":"text/html"
    }
    

    The only thing you can't do currently is easily get the 'body' of the HTTP server request.

About

Avatar for Gordon @Gordon started