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.