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

Happy Eyeballs with Axios? #4534

Open
josedgm opened this issue Mar 18, 2022 · 6 comments
Open

Happy Eyeballs with Axios? #4534

josedgm opened this issue Mar 18, 2022 · 6 comments

Comments

@josedgm
Copy link

josedgm commented Mar 18, 2022

Hi

Is there a way to implement something like Happy Eyeballs (RFC 8305) in Axios?

This means that if a hostname has several A records in its DNS answer, Axios must continue trying IP after IP until one gets a proper reply.

Currently, Axios only uses the 1st IP from the DNS reply. Is there a way to force it to continue trying other IPs if the first one is not responsive?

Thanks

@github-actions
Copy link
Contributor

Hello! 👋

This issue is being automatically closed because it does not follow the issue template. Please read the issue template carefully and follow all of the instructions when opening a new issue.

Thanks

@jasonsaayman
Copy link
Member

Hi,

There is no support for this, however if you want to give it a shot please open a pull request and tag me to review it.

Thanks

@jasonsaayman jasonsaayman reopened this Mar 19, 2022
@rpassmore01
Copy link

I am going to try to add this feature unless someone else is already working on this.

@Rishi556
Copy link

Rishi556 commented Sep 8, 2022

@rpassmore01 Have you made any progress?

@rpassmore01
Copy link

Sorry I forgot to follow up with this one. I did quite a bit of work trying to get this working, but realized during testing that the HTTP library's request does in fact check other addresses including ipv4 and ipv6. I'm pretty sure that the HTTP library does not use the happy eyeballs algorithm under the hood, so this could still be implemented into Axios. However, it seemed redundant to me since all IPv4 and IPv6 addresses are checked anyways.

@CommanderStorm
Copy link

@josedgm
I think this issue is resolved partially in node > 20 as stated in nodejs/node#48145 as node now supports Happy Eyeballs.

(tracking the rest upstream seems like a solid choice)

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

5 participants