Skip to content

when adding "target" property for the http-proxy - data is not received - appear to be Buffer #7

@syberkitten

Description

@syberkitten

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);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions