I have encountered a weird problem I don't know how to fix. I use the following code to print the body of the response.
proxy_response.setEncoding('utf-8');
proxy_response.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
proxy_response.on('end', function() {
console.log('No more data in response.')
});
This code works fine with this website, but if I try it with Agar.io, it fails and prints a weird sequence of characters, even thogh the encoding is correct (According to the meta charset attribute of the response). I can view the correct source with chrome by typing view-source:agar.io
into the search bar (This is what I would want my program to print). This is how the response looks like. This is the code I am confused about.