From 3500f71280f805ecd25ad446c93cf50c8769d395 Mon Sep 17 00:00:00 2001 From: rossilor95 Date: Thu, 22 Feb 2024 15:59:41 +0100 Subject: [PATCH] docs: update ProxyAgent documentation --- docs/api/ProxyAgent.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/api/ProxyAgent.md b/docs/api/ProxyAgent.md index cebfe689f39..eaa6329f473 100644 --- a/docs/api/ProxyAgent.md +++ b/docs/api/ProxyAgent.md @@ -16,7 +16,7 @@ Returns: `ProxyAgent` Extends: [`AgentOptions`](Agent.md#parameter-agentoptions) -* **uri** `string` (required) - It can be passed either by a string or a object containing `uri` as string. +* **uri** `string | URL` (required) - The URI of the proxy server. This can be provided as a string, as an instance of the URL class, or as an object with a `uri` property of type string. * **token** `string` (optional) - It can be passed by a string of token for authentication. * **auth** `string` (**deprecated**) - Use token. * **clientFactory** `(origin: URL, opts: Object) => Dispatcher` (optional) - Default: `(origin, opts) => new Pool(origin, opts)` @@ -30,6 +30,8 @@ import { ProxyAgent } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') // or +const proxyAgent = new ProxyAgent(new URL('my.proxy.server')) +// or const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server' }) ```