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

support for proxying multiple BEE_API_URLs #501

Open
rampall opened this issue Jul 31, 2024 · 2 comments
Open

support for proxying multiple BEE_API_URLs #501

rampall opened this issue Jul 31, 2024 · 2 comments

Comments

@rampall
Copy link

rampall commented Jul 31, 2024

  • allow comma separated values for BEE_API_URL
  • cycle requests between those URLs as a simple load balancer
@Cafe137
Copy link
Collaborator

Cafe137 commented Aug 28, 2024

config.ts

  1. const beeApiUrl = BEE_API_URL || DEFAULT_BEE_API_URL split by comma and pluralise

proxy.ts

  1. Change interface Options, replace beeApiUrl: string with string[]
  2. Pick one in beeApiUrl in fetchAndRespond

stamps.ts

  1. Rewrite get postageStamp(): string with custom logic to select stamp (or ignore if using custom middleware for stamps)

@Cafe137
Copy link
Collaborator

Cafe137 commented Aug 28, 2024

There is a Bee instance created in server.ts:

const bee = new Bee(beeApiUrl)

However, it is used only for readiness checks, exposing Bee identity, and homepage. If you don't need those features, feel free to ignore it.

Simple but ugly fix is using beeApiUrls[0] instead.

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

No branches or pull requests

2 participants