Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Merge requests
  • !497

ProxyTable updated to support 'default' route

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/yanneves/master into master Oct 11, 2013
  • Overview 1
  • Commits 3
  • Pipelines 0
  • Changes 3

Created by: yanneves

Towards the end of putting this together and testing it works, I found a solution combining regex entries in the proxy table to achieve a default to similar effect. But, this certainly makes for a tidier solution so I'll put it forward.

Have included an example in this pull request to demonstrate what I'm trying to do.

The ProxyTable will now support a 'default' entry (unless hostnameOnly:true is flagged).

var options = {
  router: {
    // normal proxy
    'localhost/proxied': 'localhost:9000',
    // default proxy if no match above,
    // this would also work if set as 'localhost'
    // but intended for more complex scenarios
    'default': 'localhost:9001'
  }
};

httpProxy.createServer(options).listen(8000);
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/yanneves/master