hapijs / h2o2

Proxy handler for hapi.js
Other
165 stars 66 forks source link

How to make load balancing proxy ? #126

Closed a-wf closed 2 years ago

a-wf commented 3 years ago

Hi I'm using hapi with H2O2 to implement a Nodejs proxy service that redirect some specific requests to another service, but I don't know how to make it load balancing. Is it possible de make it with H2O2 plugin?

devinivy commented 3 years ago

That's an interesting question. It's not specifically a feature of h2o2, but I think you could achieve it. One way you might approach is this using the mapUri option to choose a host from a list for each request.

Nargonath commented 3 years ago

You'll have to develop yourself the whole logic though: selection algorithm (round-robin or whatnot), determining which host is suitable for traffic load etc. IMO you'd better be using a dedicated tool for that such as Traefik.