Add SOCKS proxy support for Bun HTTP client

Implements SOCKS5 and SOCKS5h proxy support as requested in issue #16812.

This adds native SOCKS proxy functionality to Bun's HTTP client:
- Support for socks5:// and socks5h:// protocols
- Environment variable support (http_proxy, https_proxy)
- Direct proxy option support in fetch()
- Full SOCKS5 handshake implementation
- Integration with existing HTTP proxy infrastructure

Key changes:
- Add SOCKSProxy.zig implementing SOCKS5 protocol
- Update HTTPThread.zig to recognize SOCKS protocols
- Modify HTTP client to handle SOCKS proxy tunneling
- Add URL helpers for SOCKS protocol detection
- Include comprehensive test coverage

Resolves issue #16812

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2025-07-20 06:51:27 +00:00
parent f380458bae
commit 381411d298
7 changed files with 583 additions and 8 deletions

View File

@@ -546,6 +546,7 @@ src/http/MimeType.zig
src/http/ProxyTunnel.zig
src/http/SendFile.zig
src/http/Signals.zig
src/http/SOCKSProxy.zig
src/http/ThreadSafeStreamBuffer.zig
src/http/URLPath.zig
src/http/websocket_client.zig