Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple http server

Tags:

node.js

Well, this might be a stupid question, but i'm as n00b as i can be, regarding node.

I set up a server, with the code we can find in any node presentation or tutorial...

var http = require('http');

var server = http.createServer(function(req, res){
    console.log('connection from: ' res.socket.remoteAddress);

    res.writeHead(200, ['Content-Type', 'text/plain']);
    res.write('Hello ');
    res.end('World');
});

server.listen('8080');

My question is, why does my server logs my message twice for every request i make from the browser?

like image 868
André Alçada Padez Avatar asked Aug 07 '11 13:08

André Alçada Padez


1 Answers

Your browser is requesting an img to use in the upper corner favicon.

like image 181
megakorre Avatar answered Sep 28 '22 21:09

megakorre