Working features details #272

Closed
Alphapage opened this Issue Jun 26, 2012 · 3 comments

Comments

Projects
None yet
3 participants

Hello,
I need help about how node-http-proxy works.
I need to use node-http-proxy to redirect to another server: if I route myserver.com:80 to otherserver.com:80, will the connection be kept alive by myserver.com where node-http-proxy is running and otherserver.com responses return to the node-http-proxy or will otherserver.com become the unique server used ?

In fact, I need more explanations to know if node-http-proxy can redirect connections to another server without keeping connections .

When proxying websockets, is it a redirection and httpProxy.setMaxSockets(n) sets httpProxy max sockets or websocket nodejs server max sockets ?

Thanks in advance for your help.

Contributor

peters commented Jun 26, 2012

var app = express();
app.configure(function(){
  app.use(function(req,res,next){
      res.writeHead(301, {'Location':'https://www.otherserver.com'+req.url, 'Expires': (new Date).toGMTString()});
      res.end();
  });
}).listen(80);

So, if I understand peters, you tell me that node-http-proxy was not made to do redirection because of your code.
But it acts only as a single entry point to distribute work inside a private network and send back the response to the client ?

Owner

indexzero commented Mar 9, 2013

Yes, that is correct.

indexzero closed this Mar 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment