Skip to content

A way to add new routes? #60

Qard opened this Issue Jun 10, 2011 · 7 comments

5 participants

Qard commented Jun 10, 2011

Say I have a server at and each time a user signs up I want to spin up a new node process that maps to, is there an easy way to add this to the route list if I'm using hostname routing, or will I need to just use the custom logic mode?

I'm thinking it'd be handy to be able to do something like this;

var proxy = httpProxy.createServer(options);
proxy.addHost('', '');

Marak commented Jun 10, 2011

@qard I think it might make the most sense to use the custom logic mode for now.

If you do really like this sugar sytnax, I think we would accept a pull request for it. You want to try a few commits to get it started?

Qard commented Jun 10, 2011

No problem, that'll work for now. I might take a crack at it on the weekend, if I can find the time.

Marak commented Jun 10, 2011

Cool! Even if you can post an attempt, I'm sure it would help guide the next person who wants to implement this :-)

ghost commented Jul 18, 2011

Yeah I would also be interested by such a feature, actualy having both addHost and removeHost would make it really easier to adapt this proxy to a changing server environment... Some news about it??

Irrelon commented Jul 19, 2011

Agreed, that would rock. I'm gonna see if I can code this now...

Irrelon commented Jul 25, 2011

I've created a system that allows you to do this now. It uses node-http-proxy and allows on-the-fly updates to the routing table without having to shutdown and restart the service:

tglines commented Feb 14, 2012

I submitted a pull request for an attempt following the style you guys were looking for here:


@indexzero indexzero added a commit that closed this issue Mar 9, 2013
@indexzero indexzero [api test] Manually merge #195 from @tglines since that fork was dele…
…ted. Update tests to use new macros. Fixes #195. Fixes #60.
@indexzero indexzero closed this in 5d515e4 Mar 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.