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

improve connection to remote #737

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

improve connection to remote #737

wants to merge 3 commits into from

Conversation

benoitc
Copy link
Owner

@benoitc benoitc commented Feb 22, 2024

This pR track different changes to provide a better UX during connection to remote.

  • happy-eyeball support
  • full support of proxy configuration from the system environnement
  • improve TCP connection reuse: remove constraint on a pool

This change implements the happy eyeballs strategy to bnring better support of IPv6 for hackney.

It follows the recommendations iof the RFC 8305. https://datatracker.ietf.org/doc/html/rfc8305
This change allows hackney, to handle the no proxy environnement variable properly. This bbring real full support of proxy setup using environnement.
?report_debug("happy eyeballs, try to connect using IPv6", [{hostname, Hostname}, {port, Port}]),
Self = self(),
Addrs = getaddrs(Hostname),
Pid = spawn_link( fun() -> try_connect(Addrs, Port, Opts, Self, {error, nxdomain}) end),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to spawn here, ,,either wya makes DNS resolution asynchronous.

@benoitc
Copy link
Owner Author

benoitc commented Feb 22, 2024

I should provide a way to bypass DNS resolution and allows the user to force the way it wants to make a connection. Also allow them to choose the preference (for those that have to support the legacy with IPv4).

@benoitc benoitc changed the title improve connection to remove improve connection to remote Feb 22, 2024
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.

None yet

1 participant