FAQ
The request lib will automatically decompress the response for you. I think you'd be better off using http.request or http.get directly and avoiding any possible double handling. You can still pipe the response as you are now.

--
Dave Kuhn
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Thursday, September 27, 2012 at 2:05 PM, Jamison Dance wrote:

I have an Express server with a route that just proxies a request to
another server and pipes it back to the client. It looks like this:

var request = require('request');
function('/whatever', function(req, res) {
request.get({url: 'http://example.com/someGzippedThing', json:
true}).pipe(res);
});

If I hit http://example.com/someGzippedThing, the response is gzipped.
However, when I hi the /whatever route of my own server, the response
is not gzipped. How can I make sure it stays gzipped when it gets
piped back to the client?

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupnodejs @
categoriesnodejs
postedSep 27, '12 at 9:06p
activeSep 27, '12 at 9:33p
posts2
users2
websitenodejs.org
irc#node.js

2 users in discussion

Jamison Dance: 1 post Dave Kuhn: 1 post

People

Translate

site design / logo © 2022 Grokbase