Skip to content

Conversation

gulbaki
Copy link
Contributor

@gulbaki gulbaki commented Jun 17, 2025

  • Detect Array.isArray(opts.base) && opts.base.length > 1
    instantiate new undici.BalancedPool(origins, undiciOpts).
  • Keep existing single-upstream behaviour untouched.
  • Added one unit tests covering balanced.
  • Updated docs
    fixes: Support load balancing across multiple base urls. #208

Checklist

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@gulbaki gulbaki requested a review from gurgunday June 17, 2025 21:21
@mcollina mcollina merged commit 0afe34c into fastify:main Jul 1, 2025
14 checks passed
@Antiavanti
Copy link
Contributor

Antiavanti commented Aug 12, 2025

@gulbaki I think this is not compatible with #157.
Or at least getUpstreamcannot be used when base: string[] is used (which should be documented).

Even type in https://github.com/fastify/fastify-reply-from/pull/157/files#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8R54 is not adjusted.
base: string where in fact is now base: string | string[].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support load balancing across multiple base urls.

4 participants