-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iis it possible to proxy streaming responses? #6
Comments
Hi @yeus 👋 You weren't missing anything, streaming wasn't supported. In #7 I've hopefully now added support so responses are streamed from the proxied source provided you aren't making use of any functionality that decorates/filters based on the response in any way (in which case the response is buffered into memory as was done previously). See ./test/streaming.test.ts for an example. If encounter any problems let me know and can re-open the issue if needed. |
Thank you, that sounds awesome! I will try it out. Is there a way to look at the response after it has been sent though? |
Sorry for the slow reply. Being honest not sure atm, not quite familiar enough with Oak to say for sure. This library doesn’t offer any way to tap or fork the response, but there may be a way to add a middleware in Oak to read off the context object what was sent. Just to FYI it seems after this lib launched Oak has since introduced its own proxy middleware - being a first class middleware maintained by the Oak project itself, it might be worth considering as suspect will support things better 😊 See: |
Issue
I have tried to find anything in documentation about this and it didn't work "out-of-the-box" for me. But I would like to proxy a streamed response.
Did I miss anything? Or is this not/already implemented?
The text was updated successfully, but these errors were encountered: