http-party / node-http-proxy

A full-featured http proxy for node.js
https://github.com/http-party/node-http-proxy
Other
13.83k stars 1.96k forks source link

Allow before/after streams for transforming the request #663

Open jcrugzz opened 10 years ago

jcrugzz commented 10 years ago

Based around the concept I outlined here. This will allow arbitrary transformations of the request being proxied as well as the response we get back.

smazurov commented 9 years ago

:+1:

philippotto commented 9 years ago

I wrote a very simple middleware which can be plugged into http-proxy. It allows modifying the proxied data by providing a simple function. It is called transformer-proxy. Maybe someone finds it useful.

The modifyResponse-middleware.js-example didn't work for me, because the data is passed in chunks and not as a whole and the content-length becomes wrong when the data length is changed.