express-http-proxy
express-http-proxy copied to clipboard
Modifying responses without buffering the entire response
Modifying responses using transform streams offers much better performance than buffering the whole response. So I wrote a connect/express middleware that makes it easy to do so. The module overwrites the response.write(), response.writeHead(), and response.end() methods, and instead first pipes the response through various streams (including decompression and compression, if necessary) that are attached the response object. I thought I'd share it with you as you may want to consider adding something similar for more efficient response modification.
https://github.com/kaysond/http-proxy-interceptor
@kaysond Thanks, this is fascinating.