{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/express/issues/2704","labels_url":"https://api.github.com/repos/strongloop/express/issues/2704/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/express/issues/2704/comments","events_url":"https://api.github.com/repos/strongloop/express/issues/2704/events","html_url":"https://github.com/strongloop/express/issues/2704","id":94929267,"number":2704,"title":"Transferring files between express instances. ","user":{"login":"NoelBaron","id":6867744,"avatar_url":"https://avatars.githubusercontent.com/u/6867744?v=3","gravatar_id":"","url":"https://api.github.com/users/NoelBaron","html_url":"https://github.com/NoelBaron","followers_url":"https://api.github.com/users/NoelBaron/followers","following_url":"https://api.github.com/users/NoelBaron/following{/other_user}","gists_url":"https://api.github.com/users/NoelBaron/gists{/gist_id}","starred_url":"https://api.github.com/users/NoelBaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoelBaron/subscriptions","organizations_url":"https://api.github.com/users/NoelBaron/orgs","repos_url":"https://api.github.com/users/NoelBaron/repos","events_url":"https://api.github.com/users/NoelBaron/events{/privacy}","received_events_url":"https://api.github.com/users/NoelBaron/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/express/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":null,"comments":15,"created_at":"2015-07-14T11:52:20Z","updated_at":"2015-07-16T02:56:19Z","closed_at":null,"body":"Hello,\r\n\r\nWhat is the best way to transfer a file from a private internal express instance to another? Currently, I'm trying to send a file from PRIV to PUB, where PUB then relays the download to the user. \r\n\r\n1. User makes a request to PUB.\r\n2. PUB requests file form PRIV. PRIV uses res.download() to send file.\r\n3. PUB gets response, clones response headers, executes res.send(res.body).\r\n4. User downloads a 0-byte file. It's appropriately named but contents are invalid.\r\n\r\nWhat am I missing for step 3? Must I save res.body to a local file and use res.download() again? \r\n\r\nYour help is much appreciated!"},"comment":{"url":"https://api.github.com/repos/strongloop/express/issues/comments/121810138","html_url":"https://github.com/strongloop/express/issues/2704#issuecomment-121810138","issue_url":"https://api.github.com/repos/strongloop/express/issues/2704","id":121810138,"user":{"login":"NoelBaron","id":6867744,"avatar_url":"https://avatars.githubusercontent.com/u/6867744?v=3","gravatar_id":"","url":"https://api.github.com/users/NoelBaron","html_url":"https://github.com/NoelBaron","followers_url":"https://api.github.com/users/NoelBaron/followers","following_url":"https://api.github.com/users/NoelBaron/following{/other_user}","gists_url":"https://api.github.com/users/NoelBaron/gists{/gist_id}","starred_url":"https://api.github.com/users/NoelBaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoelBaron/subscriptions","organizations_url":"https://api.github.com/users/NoelBaron/orgs","repos_url":"https://api.github.com/users/NoelBaron/repos","events_url":"https://api.github.com/users/NoelBaron/events{/privacy}","received_events_url":"https://api.github.com/users/NoelBaron/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T02:56:19Z","updated_at":"2015-07-16T02:56:19Z","body":"@dougwilson Thanks for your help, http-proxy was the way to go! Three lines, covers all request methods, handles uploads and downloads perfectly! \r\n\r\nQuestion: Would it be better for performance to move `createProxyServer()` outside of the route? \r\n\r\n```javascript\r\napp.all('/some/route', function (req, res) {\r\n  var target = 'http://priv/some/route';\r\n  var proxy = httpProxy.createProxyServer(); // questionable placement?\r\n  proxy.web(req, res,{ target:target, ignorePath:true })\r\n})\r\n\r\n\r\n```"}}