Androidでnode.js v0.11を実行しています( https://github.com/paddybyers/node経由)。http://howtonode.org/hello-nodeにある「Hello HTTP」の例を試してみましたが、問題が発生しました。
サーバーは正常に起動しますが、( にアクセスして) http サーバーに接続しようとするとすぐに、http://localhost:8000/
次のエラーが発生します。
net.js:1156
COUNTER_NET_SERVER_CONNECTION(socket);
^
ReferenceError: COUNTER_NET_SERVER_CONNECTION is not defined
at TCP.onconnection (net.js:1156:3)
私のコードは、Hello HTTP の例とまったく同じです。
//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/");
どうすればこれを修正できますか?
ありがとう!