feat(ext/fetch): support localAddress option in custom HTTP client (#28781)

Fixes https://github.com/denoland/deno/issues/27376
Fixes https://github.com/denoland/deno/issues/23373

Example usage:

```js
const client = Deno.createHttpClient({
  localAddress: "127.0.0.2",
});
const response = await fetch("http://localhost:4545/local_addr", {
  client,
});
```
This commit is contained in:
Divy Srivastava 2025-04-25 05:33:24 -07:00 committed by GitHub
parent a44ed9bbe4
commit 6f4472c5dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 83 additions and 7 deletions

View file

@ -6208,6 +6208,8 @@ declare namespace Deno {
* @default {false}
*/
allowHost?: boolean;
/** Sets the local address where the socket will connect from. */
localAddress?: string;
}
/**