robobun
908ab9ce30
feat(fetch): add proxy object format with headers support ( #25090 )
...
## Summary
- Extends `fetch()` proxy option to accept an object format: `proxy: {
url: string, headers?: Headers }`
- Allows sending custom headers to the proxy server (useful for proxy
authentication, custom routing headers, etc.)
- Headers are sent in CONNECT requests (for HTTPS targets) and direct
proxy requests (for HTTP targets)
- User-provided `Proxy-Authorization` header overrides auto-generated
credentials from URL
## Usage
```typescript
// Old format (still works)
fetch(url, { proxy: "http://proxy.example.com:8080 " });
// New object format with headers
fetch(url, {
proxy: {
url: "http://proxy.example.com:8080 ",
headers: {
"Proxy-Authorization": "Bearer token",
"X-Custom-Proxy-Header": "value"
}
}
});
```
## Test plan
- [x] Test proxy object with url string works same as string proxy
- [x] Test proxy object with headers sends headers to proxy (HTTP
target)
- [x] Test proxy object with headers sends headers in CONNECT request
(HTTPS target)
- [x] Test proxy object with Headers instance
- [x] Test proxy object with empty headers
- [x] Test proxy object with undefined headers
- [x] Test user-provided Proxy-Authorization overrides URL credentials
- [x] All existing proxy tests pass (25 total)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
---------
Co-authored-by: Claude Bot <claude-bot@bun.sh >
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-26 15:11:45 -08:00
..
2025-11-10 14:38:26 -08:00
2025-07-22 17:51:38 -07:00
2025-11-17 15:04:42 -05:00
2025-11-10 14:38:26 -08:00
2025-11-18 10:49:21 -08:00
2025-11-20 20:56:02 -08:00
2025-07-22 17:51:38 -07:00
2025-11-26 15:11:45 -08:00
2025-11-23 20:27:15 -08:00
2025-11-23 00:34:27 -08:00
2025-11-24 23:34:16 -08:00
2025-11-19 21:20:55 -08:00
2025-11-10 14:38:26 -08:00
2025-11-18 14:02:21 -08:00
2025-11-20 20:56:02 -08:00
2025-11-10 14:38:26 -08:00
2025-07-22 17:51:38 -07:00
2025-11-23 01:41:17 -08:00
2025-11-26 15:11:45 -08:00
2025-11-21 14:06:19 -08:00
2025-11-24 19:22:45 -08:00
2025-11-19 21:20:55 -08:00
2025-11-10 14:38:26 -08:00
2025-11-20 23:37:31 -08:00
2025-07-21 13:26:47 -07:00
2025-11-10 14:38:26 -08:00
2025-10-03 17:10:28 -07:00
2025-11-17 11:23:13 -08:00
2025-11-24 20:16:03 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-18 10:49:21 -08:00
2025-11-18 14:02:21 -08:00
2025-11-10 14:38:26 -08:00
2025-11-20 20:56:02 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-15 16:36:15 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-10-04 02:17:55 -07:00
2025-10-31 19:50:55 -07:00
2025-11-26 00:02:43 -08:00
2025-11-05 15:28:28 -08:00
2025-07-29 19:35:46 -07:00
2025-11-10 14:38:26 -08:00
2025-07-22 17:51:38 -07:00
2025-10-23 23:08:08 -07:00
2025-07-22 17:51:38 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-07-20 23:04:17 -07:00
2025-11-26 00:02:43 -08:00
2025-11-18 10:49:21 -08:00
2025-11-25 11:06:24 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 19:58:02 -08:00
2025-10-24 23:42:20 -07:00
2025-11-21 14:06:19 -08:00
2025-09-26 15:19:45 -07:00
2025-11-18 10:49:21 -08:00
2025-10-29 19:29:04 -07:00
2025-11-03 22:20:07 -08:00
2025-11-10 14:38:26 -08:00
2025-11-20 20:56:02 -08:00
2025-11-20 20:56:02 -08:00
2025-07-21 13:26:47 -07:00
2025-09-26 22:21:00 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-07-21 13:26:47 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 19:58:02 -08:00
2025-11-20 23:37:31 -08:00
2025-11-10 14:38:26 -08:00
2025-11-18 10:49:21 -08:00
2025-10-23 23:08:08 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-08-23 06:55:30 -07:00
2025-10-04 00:31:47 -07:00
2025-11-10 14:38:26 -08:00
2025-10-02 14:11:29 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-07-22 17:51:38 -07:00
2025-09-09 20:41:10 -07:00
2025-11-26 15:11:45 -08:00
2025-10-14 20:51:34 -07:00
2025-11-10 14:38:26 -08:00
2025-08-23 06:55:30 -07:00
2025-07-22 17:51:38 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-15 16:36:15 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-10-23 23:08:08 -07:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-10-18 18:14:01 -07:00
2025-11-10 14:38:26 -08:00
2025-07-22 17:51:38 -07:00
2025-09-14 04:14:48 -07:00
2025-11-17 15:04:42 -05:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-09-30 00:10:15 -07:00
2025-11-10 14:38:26 -08:00
2025-10-23 23:08:08 -07:00
2025-11-10 14:38:26 -08:00
2025-11-13 19:29:16 -08:00
2025-09-26 15:15:58 -07:00
2025-11-10 14:38:26 -08:00
2025-11-15 16:36:15 -08:00
2025-09-26 22:21:00 -07:00
2025-11-10 14:38:26 -08:00
2025-09-03 15:40:44 -07:00
2025-09-22 19:28:26 -07:00
2025-07-21 13:26:47 -07:00
2025-11-10 14:38:26 -08:00
2025-11-18 10:49:21 -08:00
2025-11-10 14:38:26 -08:00
2025-11-23 01:42:32 -08:00
2025-07-13 04:27:43 -07:00
2025-07-13 04:27:43 -07:00
2025-07-13 04:27:43 -07:00
2025-11-10 14:38:26 -08:00
2025-11-18 10:49:21 -08:00
2025-07-21 13:26:47 -07:00
2025-09-03 15:40:44 -07:00
2025-07-25 12:38:06 -07:00
2025-11-10 14:38:26 -08:00
2025-11-17 15:04:42 -05:00
2025-10-03 17:10:28 -07:00
2025-07-21 13:26:47 -07:00
2025-11-26 13:46:08 -08:00
2025-07-21 13:26:47 -07:00
2025-11-10 14:38:26 -08:00
2025-11-18 10:49:21 -08:00
2025-07-22 17:51:38 -07:00
2025-08-11 20:19:34 -07:00
2025-07-20 23:04:17 -07:00
2025-11-18 10:49:21 -08:00
2025-07-21 13:26:47 -07:00
2025-11-10 14:38:26 -08:00
2025-07-21 13:26:47 -07:00
2025-11-10 14:38:26 -08:00