Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7853483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:42:42+00:00 2026-06-02T19:42:42+00:00

im using following code for http-proxy: var httpProxy = require(‘http-proxy’); var options = {

  • 0

im using following code for http-proxy:

var httpProxy = require('http-proxy');

var options = {
    router: {
    'url1.com': '127.0.0.1:3000',
    'url2.com': '127.0.0.1:3001'
    }
};

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

My question is, can i update the routetable dynamically? Without shuting down proxy server?

Thx for answers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:42:43+00:00Added an answer on June 2, 2026 at 7:42 pm

    For everyone facing that problem, finally i got the solution out of the box. Its all possible, if u pass a string pointing to a file, instead of passing an object as arg. I’ll give an example and it should be clear.

    proxy.js:

    var httpProxy = require('http-proxy');
    var options   = { router: 'table.json' };
    
    httpProxy.createServer(options).listen(80);
    

    As u see here, i pass table.json as router option. So look inside that file.

    table.json:

    {
       "router":
       {
          "domain1.com": "127.0.0.1:8080",
          "domain2.com": "127.0.0.1:8001"
       }
    }
    

    And thats the whole magic. node-http-proxy will monitor that file, and if you do any changes on it, it will update its routetable automatically.

    Greetings

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using 'git' to checkout chromium code by following this document: http://code.google.com/p/chromium/wiki/UsingGit And
I'm following the barcode tutorial for this site: http://brismith66.blogspot.com/2010_07_01_archive.html using the google code: http://code.google.com/p/wsdl2objc/
Greetings, I'm uploading an image to my server using the following code: http://cocoadev.com/index.pl?HTTPFileUploadSample However,
Im using the following code <script src=http://code.jquery.com/jquery-latest.js></script> <script> //Document ready $(document).ready(function(){ //Show info $('a.getinfo').live(click,
I'm using the following code to rotate an image http://www.platinumball.net/blog/2010/01/31/iphone-uiimage-rotation-and-scaling/ that's one of the
i am using the following code(based on this http://goo.gl/5HhSx ) to calculate the difference
Following is the code of my activity I am using for sending an HTTP
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using following code: var genres1 = new Ext.data.Store({ reader: new Ext.data.JsonReader({ fields:
I'm using svcutil to generate proxy code for the following web service endpoint which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.