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

Implement RFC 8305, the "Happy Eyeballs". #793

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

midnight-wonderer
Copy link
Contributor

Overview

This addresses #739.

Happy Eyeballs landed in Ruby for quite some time. 🎉
https://bugs.ruby-lang.org/issues/20108

However, it does not reach HTTP.rb yet.
This is because HTTP.rb uses TCPSocket.open by default.

Source traces

A baby step

In order to take advantage of the new feature. I alias default_socket_class to Socket.tcp so the connection logic will be handled by the Ruby layer of Socket.

Rough edges

For your information Socket.tcp has a lot of features beyond Happy Eyeballs.
For example, it supports connect_timeout natively.
What to do with

::Timeout.timeout(@time_left, ConnectTimeoutError) do
needs more discussions.
This is just one aspect of it.

Nevertheless, this baby step would introduce minimal breaking changes. (or any changes at all)
Providing more robust connections.

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

Successfully merging this pull request may close these issues.

1 participant