No9 / harmon

middleware for node-http-proxy to modify the remote website response with trumpet
Other
424 stars 62 forks source link

Received only a part of the data #21

Closed betlab closed 9 years ago

betlab commented 9 years ago

Hi. If in the script simple.js change target for example to the http://dou.ua/test. We will receive only a part of the html page data. How to use it correctly? Thx

betlab commented 9 years ago

Ok, it happens at https://github.com/No9/harmon/blob/master/index.js#L52 If the response contains gzipped data

No9 commented 9 years ago

Hey thanks for this. We had a similar issue raised a while back https://github.com/No9/harmon/issues/19

I can see two options :

  1. As outlined in https://github.com/No9/harmon/issues/19 remove the Accept gzip header from the request as it comes into harmon.
  2. If the content is gzipped then pipe the response from the remote server to a function to decompress before handing it to trumpet.
No9 commented 9 years ago

Hey @betlab going to close this off. If you have any further questions please spin up an issue.

No9 commented 9 years ago

@betlab Gzip support and a sample has been added to the repo https://github.com/No9/harmon/blob/master/examples/gzipped.js

betlab commented 9 years ago

Thx!