Skip to content
Back to top
View this page

# Welcome to aiohappyeyeballs documentation!

Installation & Usage

- API Reference
- Installation
- Usage

Project Info

- Changelog
  - v2.7.1 (2026-07-01)
  - v2.7.0 (2026-05-20)
  - v2.6.2 (2026-05-20)
  - v2.6.1 (2025-03-12)
  - v2.6.0 (2025-03-11)
  - v2.5.0 (2025-03-06)
  - v2.4.8 (2025-03-04)
  - v2.4.7 (2025-03-04)
  - v2.4.6 (2025-02-07)
  - v2.4.5 (2025-02-07)
  - v2.4.4 (2024-11-30)
  - v2.4.3 (2024-09-30)
  - v2.4.2 (2024-09-27)
  - v2.4.1 (2024-09-26)
  - v2.4.0 (2024-08-19)
  - v2.3.7 (2024-08-17)
  - v2.3.6 (2024-08-16)
  - v2.3.5 (2024-08-07)
  - v2.3.4 (2024-07-31)
  - v2.3.3 (2024-07-31)
  - v2.3.2 (2024-01-06)
  - v2.3.1 (2023-12-14)
  - v2.3.0 (2023-12-12)
  - v2.2.0 (2023-12-11)
  - v2.1.0 (2023-12-11)
  - v2.0.0 (2023-12-10)
  - v1.8.1 (2023-12-10)
  - v1.8.0 (2023-12-10)
  - v1.7.0 (2023-12-09)
  - v1.6.0 (2023-12-09)
  - v1.5.0 (2023-12-09)
  - v1.4.1 (2023-12-09)
  - v1.4.0 (2023-12-09)
  - v1.3.0 (2023-12-09)
  - v1.2.0 (2023-12-09)
  - v1.1.0 (2023-12-09)
  - v1.0.0 (2023-12-09)
  - v0.9.0 (2023-12-09)
  - v0.8.0 (2023-12-09)
  - v0.7.0 (2023-12-09)
  - v0.6.0 (2023-12-09)
  - v0.5.0 (2023-12-09)
  - v0.4.0 (2023-12-09)
  - v0.3.0 (2023-12-09)
  - v0.2.0 (2023-12-09)
  - v0.1.0 (2023-12-09)
  - v0.0.1 (2023-12-09)
- Contributing
  - Types of Contributions
  - Get Started!
  - Pull Request Guidelines
  - Tips
  - Making a new release

# aiohappyeyeballs

Documentation: https://aiohappyeyeballs.readthedocs.io

Source Code: https://github.com/aio-libs/aiohappyeyeballs

Happy Eyeballs (RFC 8305)

## Use case

This library exists to allow connecting with Happy Eyeballs (RFC 8305) when you already have a list of addrinfo and not a DNS name.

The stdlib version of `loop.create_connection()` will only work when you pass in an unresolved name which is not a good fit when using DNS caching or resolving names via another method such as `zeroconf`.

## Installation

Install this via pip (or your favourite package manager):

`pip install aiohappyeyeballs`

## License

aiohappyeyeballs is licensed under the same terms as cpython itself.

## Example usage

    addr_infos = await loop.getaddrinfo("example.org", 80)

    socket = await start_connection(addr_infos)
    socket = await start_connection(addr_infos, local_addr_infos=local_addr_infos, happy_eyeballs_delay=0.2)

    transport, protocol = await loop.create_connection(
        MyProtocol, sock=socket, ...)

    # Remove the first address for each family from addr_info
    pop_addr_infos_interleave(addr_info, 1)

    # Remove all matching address from addr_info
    remove_addr_infos(addr_info, "dead::beef::")

    # Convert a local_addr to local_addr_infos
    local_addr_infos = addr_to_addr_infos(("127.0.0.1",0))

## Credits

This package contains code from cpython and is licensed under the same terms as cpython itself.

This package was created with Copier and the browniebroke/pypackage-template project template.