I'm trying to send responses in chunks with gzip but from following example I'm getting "Hello�S�/�I�m���S��k�" in Chrome instead "Hello World!"
var http = require('http'), zlib = require('zlib'); http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'html/text', 'Transfer-Encoding': 'chunked', 'Content-Encoding': 'gzip', 'Content-Type': 'text/html;charset=UTF-8' }); zlib.gzip("Hello", function(_, result) { res.write(result); }); zlib.gzip(" World", function(_, result) { res.write(result); }); zlib.gzip('!', function(_, result) { res.end(result); }); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');