aiohappyeyeballs
Happy Eyeballs for asyncio
This package has a good security score with no known vulnerabilities.
Community Reviews
Solid RFC 8305 implementation that just works, but limited documentation
In production, it reliably handles edge cases like IPv6-only networks, slow DNS responses, and mixed connectivity scenarios. The type hints are solid and work well with mypy/pylance, giving proper autocompletion for the returned reader/writer tuple. Error handling propagates asyncio exceptions naturally, making it behave predictably in failure scenarios.
The main weakness is documentation - while the API is intuitive enough that you can figure it out from type hints alone, there's minimal explanation of configuration options, timeout behavior, or best practices. The package does one thing well but assumes you understand Happy Eyeballs concepts already. For most users integrating aiohttp or other libraries that use this under the hood, you won't interact with it directly.
Best for: Projects needing reliable dual-stack IPv4/IPv6 connection handling in asyncio without manual complexity.
Avoid if: You need extensive customization of connection attempt behavior or detailed documentation for team onboarding.
Low-level but essential IPv4/IPv6 dual-stack connection helper
The API is minimal and focused: `start_connection()` returns a coroutine that yields connected sockets, trying IPv6 and IPv4 in parallel with proper fallback delays. There's virtually no learning curve if you understand asyncio sockets. Type hints are complete and accurate, making IDE integration seamless. Error handling is straightforward—exceptions bubble up from the underlying socket operations without wrapping.
Documentation is sparse but the API surface is small enough that it doesn't matter much. The README has a basic usage example that's sufficient for most cases. Since this is infrastructure-level code, you'll rarely need to debug it—it just works quietly in the background handling network connection race conditions.
Best for: Projects needing low-level control over dual-stack asyncio socket connections or building async network clients from scratch.
Avoid if: You're using a higher-level HTTP client like aiohttp or httpx that already handles this internally.
Solid RFC 8305 implementation with minimal surface area
From a security perspective, this is refreshingly minimal - it's essentially plumbing between your DNS resolution and socket connection. There's no TLS handling (happens upstream in your stack), no credential management, and no complex configuration to misconfigure. The library doesn't introduce dependency bloat and error handling is clean, raising connection errors appropriately without leaking internal state.
The main gotcha is understanding where it fits: it sits between `getaddrinfo()` and socket connection, so you still need to handle TLS context setup yourself. Documentation could better explain the stagger delay tuning, but defaults follow RFC recommendations sensibly. It's maintained actively with quick CVE response when issues arise in the ecosystem.
Best for: Projects needing RFC 8305 Happy Eyeballs for dual-stack asyncio connections with minimal dependency overhead.
Avoid if: You need a batteries-included HTTP client - use aiohttp or httpx which integrate this internally.
Sign in to write a review
Sign In