Streaming a PNG in node.js 1 var sys = require('sys'), 2 http = require('http'), 3 url = require('url'); 4 5 http.createServer(function (request, response) { 6 var f = (url.parse(request.url, true)).query.file 7 fs = require('fs'), 8 path = './' + f, 9 rs = fs.createReadStream(path); 10 11 response.writeHead(200, { 'Content-Type': 'image/png' }); 12 rs.addListener('data', function (b) { 13 respo