Skip to content

Set proxy for some fetch request (not all) #1350

@tamaina

Description

@tamaina

I apologize if this has already been implemented or issue created, but I could not find this usage in the documentation.

This would solve...

I would like to specify a proxy for each fetch run.

The implementation should look like...

Deno implements as follows PR:
denoland/deno#10907

In undici, it would become as follows...?

import { ProxyAgent } from 'undici';

const client = new ProxyAgent('localhost:3000');
const response = await fetch("https://myserver.com", { client });

(Is ProxyAgent better than Client?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions