0

I have a node-http-proxy server using the proxytable configuration:

var options = {
  router: {
    'a' : '127.0.0.1:81',
    'b': '127.0.0.1:82',
    'c': '127.0.0.1:83',
    'else' : '127.0.0.1:5000'
  }
};

httpProxy.createServer(options).listen(80);

Is there a way to run it so if the hostname is neither a, b, or c to use the else server?

Tarang
  • 75,157
  • 39
  • 215
  • 276

1 Answers1

0

This may not have been possible at the time you asked the question, but the route table now supports regex:

var options = {
  router: {
    'a' : '127.0.0.1:81',
    'b': '127.0.0.1:82',
    'c': '127.0.0.1:83',
    '.*' : '127.0.0.1:5000'
  }
};
Mike Hogan
  • 9,933
  • 9
  • 41
  • 71