var http = require('http'),
    fs = require('fs');

var server = http.createServer(function (req, res) {

    var realUrl = req.url;
    if (/\?/.test(req.url)) {
        var realUrl = req.url.split('?')[0];

    }
    var file = __dirname + realUrl;

    function error(req, res) {
        console.log('ERROR: \n', req.url, '\nFILE:\n', file);
        res.end('Error')
    }

    try {

        console.log('REQUEST: \n', req.url, '\nFILE:\n', file);
        if (fs.existsSync(file)) {
            var stream = fs.createReadStream(file);
            stream.pipe(res);
        } else {
            error(req, res);
        }

    }catch(e) {
        error(req, res);
    }

});
server.listen(8000);



@@ -96,24 +96,55 @@
 eq, res) %7B%0A%0A
+    var headers = req.headers;%0A
     var real
@@ -158,16 +158,16 @@
 eq.url;%0A
-
     if (
@@ -240,16 +240,22 @@
 %0A%0A    %7D%0A
+    %0A%0A
     var 
@@ -404,24 +404,24 @@
 or')%0A    %7D%0A%0A
-
     try %7B%0A%0A 
@@ -417,16 +417,141 @@
    try %7B
+%0A        %0A        if (headers.connection === 'keep-alive') %7B%0A            res.setHeader(%22connection%22, %22keep-alive%22);%0A        %7D
 %0A%0A      

add keep-alive in server