transformer-proxy
transformer-proxy copied to clipboard
when adding "target" property for the http-proxy - data is not received - appear to be Buffer
my use case is to create a proxy for the browser, which means i want to route requests through my proxy, and not to a specific proxied server.
the issue is easy to reproduce, using the promise.js example, no response is being returned, actually the data inside the transformerFunction appears to be a Buffer
//var proxy = httpProxy.createProxyServer({target: 'http://localhost:' + proxiedPort});
var proxy = httpProxy.createProxyServer({}); // we don't want to set up the target right now
app.use(transformerProxy(transformerFunction));
app.use(function (req, res) {
var target = 'http://' + req.headers.host;
// This is where we set the target we want
proxy.web(req, res, {target:target});
//proxy.web(req, res);
});