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
  • !1574

Add lookup option to override dns lookups

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Oscar Busk requested to merge github/fork/oBusk/dns-lookup into master Feb 24, 2022
  • Overview 0
  • Commits 3
  • Pipelines 1
  • Changes 4

The cause of this is that when proxying api requests to a hostname, node will perform a dns query for every single request, which adds unnecessary overhead. While I was investigating I found https://github.com/nodejs/node/issues/5893 and understood that there is no built in dns caching in node and that it seemingly bypasses OS dns cache. Adding a dns cache into http-proxy would clearly not be optimal, but by exposing the lookup option for request() we can customize the dns lookup that http-proxy performs and add our own cache, or inject https://www.npmjs.com/package/dns-lookup-cache or something similiar. (fixes #653)

This configuration would also allow to customize the DNS lookup (fixes #1315)

One problem with this is that the request() lookup option is only available in node v12 and later, so using the option when running node 8/10 would not have any effect. shouldn't implode either, but does nothing.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/oBusk/dns-lookup