HTTP Server on Android via node.js errors upon request

I'm running node.js v0.11 on Android (via https://github.com/paddybyers/node). I attempted to try out the "Hello HTTP" example found here: http://howtonode.org/hello-node, however, I ran into problems.

The server starts fine, but as soon as I attempt to connect to the http server (by visiting http://localhost:8000/), I get this error:

net.js:1156
  COUNTER_NET_SERVER_CONNECTION(socket);
  ^
ReferenceError: COUNTER_NET_SERVER_CONNECTION is not defined
    at TCP.onconnection (net.js:1156:3)

My code is exactly the same as the Hello HTTP example:

//Load the http module to create an http server.
var http = require('http');

// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello World\n");
});

// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);

// Put a friendly message on the terminal
console.log("Server running at http://127.0.0.1:8000/");

How can I fix this?

Thanks!

Compile Node.js with the HAVE_PERFCTR option. (You Need to implement your own perfctrs for Android. See node_counters.cc line 130).

It should be also possible to define the missing functions in your script as empty functions.

PS.: You also need DTRACE.

I simply commented out all COUNTER_NET_, COUNTER_HTTP_, DTRACE_NET_, and DTRACE_HTTP_ calls in the javascript files under lib/. This amounted to about 10 or so lines that I commented out of net.js and http.js.

I think that js2c.py is supposed to process src/macros.py and src/perfctr_macros.py to effectively do this 'commenting out' for you when it serializes the scripts under lib/ to C arrays in out/release/src/node_natives.h, but that doesn't seem to be happening.