-
Notifications
You must be signed in to change notification settings - Fork 3k
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
inet6 to inet fallback in networks without ipv6 support #8548
Comments
In place of a "ping": I would also happily work on implementing happy eyeballs into Erlang! Related issues / discussions / projects:
|
I believe built-in happy eyeballs implementation would be a huge win for the ecosystem. 👍 |
Yes! |
I believe that the idea is that gen_tcp (and gen_udp, gen_sctp) should be "close to the metal". I my memory is correct the inets (httpd and httpc) had a similar config option (inet6fb4 or something like it). I do not know if ssl has this feature. 'socket' is very much "close to the metal". But gen_tcp could maybe be considered to be a layer that |
This is the kind of feature that sits between OTP and application I think. It makes sense to have it in OTP because many would use it, but not all network connections require it either. It could be a separate open source project, but then who has the will and the bandwidth to maintain it? Happy Eyeballs is also tricky in that it pretty much requires connecting via 4/6 concurrently. The The alternative is building on top of If we could "upgrade" a |
FWIW, I started working on https://github.com/ruslandoga/happy_tcp and will be trying to implement Happy Eyeballs by using
I haven't looked into
So far, happy_tcp seems to work without any changes but it would be nice if inet_tcp_backend "behaviour" could connect to multiple addresses instead of just one, then my hack of passing a list of addresses could go away. But my ideal would be having |
The OTP changes are needed to keep the same interface, i.e. once the connection has succeeded you use |
👋
Is your feature request related to a problem? Please describe.
Not sure yet. First I'd like double check if
gen_tcp:connect
andssl:connect
withinet6
option are supposed to fallback toinet
when IPv6 connection is not successful. And if it's not supposed to work this way, I'd like to request this feature!Right now I'm not able to make this sort of fallback work. Here're some examples from Fly.io dual-stack machine and from an IPv4-only container running on AWS EC2. I'm using IPv4-only and IPv6-only hosts from http://dual.tlund.se
From Fly.io Machine
Connecting to IPv4-Only Host works with default
inet
optionBut fails when
inet6
option is providedipv6_v6only
doesn't HelpDefault options (
inet
) don't work with IPv6-only hostinet6
works with IPv6-only hostFrom IPv4-only container on AWS EC2
No fallback to
inet
Describe the solution you'd like
inet6
would fallback toinet
automatically when needed so that providinginet6
option would always increase the chance of a successful connection.Describe alternatives you've considered
Some Elixir libraries perform a manual fallback from inet6 to inet like Mint and some other libraries like Postgrex allow a list of endpoints to be provided for connection attempts.
Additional context
Relevant discussion (where this question originated): phoenixframework/phoenix#4289 (comment)
The text was updated successfully, but these errors were encountered: