mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
The family option in https.Agent (e.g., {family: 6} for IPv6) was not being
passed to the DNS lookup function, causing DNS resolution to return both IPv4
and IPv6 addresses regardless of the family setting. This meant that IPv6-only
connections would fall back to IPv4.
Changes:
- Add default DNS lookup function when not provided in ClientRequest
- Pass agent's family option to DNS lookup when available
- Ensure DNS lookup respects family filtering for proper address selection
This allows users to force IPv6-only connections using:
```js
const agent = new https.Agent({ family: 6 });
https.request({ hostname: 'example.com', agent }, callback);
```
Fixes issue where IPv6 family setting was ignored.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>