Pipe superagent response to express response
I'm trying to "proxy" some file with an express app. Why the code below doesn't work? var app = require('express')() var request = require('superagent') app.get('/image', function(req, res, next) { request('http://s3.amazonaws.com/thumbnails.illustrationsource.com/huge.104.520060.JPG') .then(function(_res) { _res.pipe(res) }) }) app.listen(3001, function() { console.log('listen') }) When I "wget" a file directly it works: $ wget http://s3.amazonaws.com/thumbnails.illustrationsource.com/huge.104.520060.JPG --2016-07-20 11:44:33-- http://s3.amazonaws.com/thumbnails.illustrationsource.com/huge