Note. This is not a replicated message for those about setting up, the key answer here is browser design options.
I am starting to learn node.js: A simple example for checking async:
var http=require('http'); http.createServer( function(request, response){ response.writeHead(200); response.write("Hello, dog is running"); setTimeout( function(){ response.write("Dog is done"); response.end(); }, 10000 ); } ).listen(8080); console.log("Listen on port 8080")
Interestingly, its behavior is different from that in the lind command with curl and in the browser: In Ubuntu 12.10, I use curl localhost: 8080 in two consoles, they respond to almost 10 messages.
However, I open two browsers, make a request almost at the same time, but the whole procedure took me 20 seconds?
thanks.
source share