mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 22:01:47 +00:00
This implementation adds support for the localAddress option in fetch(), allowing users to bind to a specific local IP address when making HTTP requests. Key changes: - Extended fetch options to parse and handle localAddress parameter - Added local_address field to HTTPClient and AsyncHTTP structures - Modified HTTP connection logic to use local address when provided - Extended usockets API with local address binding support - Implemented socket binding at the BSD level using bind() syscall - Added comprehensive test coverage for the new functionality The implementation follows the existing unix socket pattern and provides graceful fallback to regular connections when local address binding fails. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>