{"action":"created","issue":{"url":"https://api.github.com/repos/villadora/express-http-proxy/issues/283","repository_url":"https://api.github.com/repos/villadora/express-http-proxy","labels_url":"https://api.github.com/repos/villadora/express-http-proxy/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/villadora/express-http-proxy/issues/283/comments","events_url":"https://api.github.com/repos/villadora/express-http-proxy/issues/283/events","html_url":"https://github.com/villadora/express-http-proxy/pull/283","id":260075248,"number":283,"title":"Stream proxied responses if no response modifiers are in use","user":{"login":"KidkArolis","id":324440,"avatar_url":"https://avatars1.githubusercontent.com/u/324440?v=4","gravatar_id":"","url":"https://api.github.com/users/KidkArolis","html_url":"https://github.com/KidkArolis","followers_url":"https://api.github.com/users/KidkArolis/followers","following_url":"https://api.github.com/users/KidkArolis/following{/other_user}","gists_url":"https://api.github.com/users/KidkArolis/gists{/gist_id}","starred_url":"https://api.github.com/users/KidkArolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KidkArolis/subscriptions","organizations_url":"https://api.github.com/users/KidkArolis/orgs","repos_url":"https://api.github.com/users/KidkArolis/repos","events_url":"https://api.github.com/users/KidkArolis/events{/privacy}","received_events_url":"https://api.github.com/users/KidkArolis/received_events","type":"User","site_admin":false},"labels":[{"id":749154712,"url":"https://api.github.com/repos/villadora/express-http-proxy/labels/next","name":"next","color":"c666f9","default":false}],"state":"closed","locked":false,"assignee":{"login":"monkpow","id":8430,"avatar_url":"https://avatars1.githubusercontent.com/u/8430?v=4","gravatar_id":"","url":"https://api.github.com/users/monkpow","html_url":"https://github.com/monkpow","followers_url":"https://api.github.com/users/monkpow/followers","following_url":"https://api.github.com/users/monkpow/following{/other_user}","gists_url":"https://api.github.com/users/monkpow/gists{/gist_id}","starred_url":"https://api.github.com/users/monkpow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkpow/subscriptions","organizations_url":"https://api.github.com/users/monkpow/orgs","repos_url":"https://api.github.com/users/monkpow/repos","events_url":"https://api.github.com/users/monkpow/events{/privacy}","received_events_url":"https://api.github.com/users/monkpow/received_events","type":"User","site_admin":false},"assignees":[{"login":"monkpow","id":8430,"avatar_url":"https://avatars1.githubusercontent.com/u/8430?v=4","gravatar_id":"","url":"https://api.github.com/users/monkpow","html_url":"https://github.com/monkpow","followers_url":"https://api.github.com/users/monkpow/followers","following_url":"https://api.github.com/users/monkpow/following{/other_user}","gists_url":"https://api.github.com/users/monkpow/gists{/gist_id}","starred_url":"https://api.github.com/users/monkpow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkpow/subscriptions","organizations_url":"https://api.github.com/users/monkpow/orgs","repos_url":"https://api.github.com/users/monkpow/repos","events_url":"https://api.github.com/users/monkpow/events{/privacy}","received_events_url":"https://api.github.com/users/monkpow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2017-09-24T10:50:54Z","updated_at":"2018-02-02T14:42:42Z","closed_at":"2018-02-02T14:42:42Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/villadora/express-http-proxy/pulls/283","html_url":"https://github.com/villadora/express-http-proxy/pull/283","diff_url":"https://github.com/villadora/express-http-proxy/pull/283.diff","patch_url":"https://github.com/villadora/express-http-proxy/pull/283.patch"},"body":"Needed for my use case where I'm proxying webpack's event-stream.\r\nBut also should be a good default for better performance.\r\n\r\nThe only thing I'm not sure about is error handling cause if this is not quite equivalent it could affect existing apps - otherwise this could be a drop in replacement. All the existing tests pass though, so I was hoping it's solid.\r\n\r\nThere are several ways to go about introducing this feature:\r\n\r\n1. (this PR) **Opt in automatically** - if no response modifiers are in use, simply stream all responses. The potential downsides are that if you just want to modify some header, but not body, that's not possible (but we could open that up in the future if needed). The other downside is potentially different behaviour from before, having said that it seems like streaming is a really good default.\r\n2. **Explicitly opt in using `options.stream` and ignore res modifiers**. Downside is you don't get streaming by default, and another option..\r\n3. **Explicitly opt it using `options.stream` and allow res modifiers**. Here, you still opt into streaming, but `skipToNextHandlerFilter` and `userResDecorator` is still allowed, it's just that proxy.resBody is null and you can only work with headers. the Kind of a bit complicated, maybe?\r\n\r\nMy thinking was, option 1 is quite seamless. And if we need to go the option 3 route later, it's possible, by introducing `options.stream` override that can be used to both force streaming completely off, or force it on even if modifiers are present but in that case no more handling of body is done.\r\n\r\nAnyway, happy to go with any of the options if you agree this is a useful feature.\r\n\r\nFixes #236 "},"comment":{"url":"https://api.github.com/repos/villadora/express-http-proxy/issues/comments/362604705","html_url":"https://github.com/villadora/express-http-proxy/pull/283#issuecomment-362604705","issue_url":"https://api.github.com/repos/villadora/express-http-proxy/issues/283","id":362604705,"user":{"login":"monkpow","id":8430,"avatar_url":"https://avatars1.githubusercontent.com/u/8430?v=4","gravatar_id":"","url":"https://api.github.com/users/monkpow","html_url":"https://github.com/monkpow","followers_url":"https://api.github.com/users/monkpow/followers","following_url":"https://api.github.com/users/monkpow/following{/other_user}","gists_url":"https://api.github.com/users/monkpow/gists{/gist_id}","starred_url":"https://api.github.com/users/monkpow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkpow/subscriptions","organizations_url":"https://api.github.com/users/monkpow/orgs","repos_url":"https://api.github.com/users/monkpow/repos","events_url":"https://api.github.com/users/monkpow/events{/privacy}","received_events_url":"https://api.github.com/users/monkpow/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T14:42:42Z","updated_at":"2018-02-02T14:42:42Z","author_association":"COLLABORATOR","body":"@KidkArolis Thanks!  This is on master now."}}
{"actor":{"display_login":"monkpow"}}