Skip to content
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

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

Open
syberkitten opened this issue Jan 26, 2017 · 0 comments

Comments

@syberkitten
Copy link

syberkitten commented Jan 26, 2017

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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant