Open ronag opened 2 years ago
@ronag Hi, I would love to contribute to this. I have one question: The functionality related to the upstream addition to the pool is synchronous (addUpstream) but the DNS resolution must be an asynchronous call. This may require a braking change in the API. If what I wrote makes sense; how do you propose to address this? Otherwise, I would like to know why I am wrong so that I can do the actual implementation. Thanks!
Hey! I'd suggest you take a look at ProxyAgent
and how does it intercepts the connect
step of the Client
to create the Proxy.
Here, there's no need to do the resolution right away, it can be delayed up to usage if the flag is enabled.
It would be useful if balanced pool would do a dns lookup on non ip upstreams to loadbalance between all ips in the dns record.