1

I tried my hands on redbird like:

var proxy = require('redbird')({port: 80});

proxy.register("http://www.example.com", "http://36.154.99.115:3000");
proxy.register("http://abc.example.com", "http://36.154.99.115:3001");
proxy.register("http://xyz.example.com", "http://36.154.99.115:3002");

and redwire like:

var RedWire = require('redwire');
proxy = new RedWire({http: { port: 80 }});

proxy.http("http://www.example.com", "http://36.154.99.115:3000");
proxy.http("http://abc.example.com", "http://36.154.99.115:3001");
proxy.http("http://xyz.example.com", "http://36.154.99.115:3002");

I can hit http://36.154.99.115:3000, http://36.154.99.115:3001 and http://36.154.99.115:3003 to successfully load the respective web pages, but when I try to hit http://www.example.com, all I get is 404 host not found.

I get the following log on my console:

{"name":"redbird","hostname":"ip-172-31-23-160","pid":3239,"level":30,"msg":"Proxying www.example.com/ to www.example.com:3000/","time":"2017-02-12T08:07:57.540Z","v":0}

which looks like success, but it actually doesn't work...

The servers running on 3000, 3001 and 3002 are using DietJS if that matters...

Note: I tried proxy.register("http://www.example.com", "http://www.facebook.com") and it worked.

Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55

1 Answers1

1

Diet.js seems to be the issue here, try porting the web-server to Express.js.

Alternatively, try creating a sample application with Express.js or something relatively generic and try redirecting to it. If that works (which hopefully would), you know what to do.

myTerminal
  • 1,596
  • 1
  • 14
  • 31