-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A way to add new routes? #60
Comments
@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? |
No problem, that'll work for now. I might take a crack at it on the weekend, if I can find the time. |
Cool! Even if you can post an attempt, I'm sure it would help guide the next person who wants to implement this :-) |
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?? |
Agreed, that would rock. I'm gonna see if I can code this now... |
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: http://www.isogenicengine.com/2011/07/25/node-js-domain-to-hostport-router/ |
I submitted a pull request for an attempt following the style you guys were looking for here: |
Say I have a server at example.com and each time a user signs up I want to spin up a new node process that maps to username.example.com, 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('username.example.com', '127.0.0.1:9000');
The text was updated successfully, but these errors were encountered: