Skip to content
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

dns round-robin interceptor + cache #3350

Open
ronag opened this issue Jun 20, 2024 · 3 comments
Open

dns round-robin interceptor + cache #3350

ronag opened this issue Jun 20, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ronag
Copy link
Member

ronag commented Jun 20, 2024

class Handler {
  // 1. resolve dns entries
  // 2. pick an ip for entry list
  // 3. const origin = new URL(opts.origin)
  // 4. origin.hostname = ip
  // 3. call dispatch({ ...opts, origin }, handler)
}

export const dnsInterceptor = dispatch => (opts, handler) => isDNSName(opts.origin.hostname)
  ? dispatch(opts, new Handler(opts, { dispatch, handler }))
  : dispatch(opts, handler)
@ronag ronag added the enhancement New feature or request label Jun 20, 2024
@ronag
Copy link
Member Author

ronag commented Jun 20, 2024

@metcoder95

@mcollina
Copy link
Member

this would need to implement Happy Eyeballs.

@metcoder95
Copy link
Member

This could be interesting, I was thinking about the same with the other closed issue but was unsure; if we are able to implement it with Happy Eyeballs will be really beneficial.

It could be good to also pick-up different strategies for distributing the load, possibly weighted or based on response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants