From ee93584ff921bc8b303f0ea0be8911b77d6d064c Mon Sep 17 00:00:00 2001 From: Carlos Fuentes Date: Fri, 13 Dec 2024 17:54:18 +0100 Subject: [PATCH] docs: enhance documentation (#3945) --- docs/docs/api/ProxyAgent.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/docs/api/ProxyAgent.md b/docs/docs/api/ProxyAgent.md index ce73195d553..932716ae795 100644 --- a/docs/docs/api/ProxyAgent.md +++ b/docs/docs/api/ProxyAgent.md @@ -15,6 +15,7 @@ Returns: `ProxyAgent` ### Parameter: `ProxyAgentOptions` Extends: [`AgentOptions`](/docs/docs/api/Agent.md#parameter-agentoptions) +> It ommits `AgentOptions#connect`. * **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. If the `uri` is provided as a string or `uri` is an object with an `uri` property of type string, then it will be parsed into a `URL` object according to the [WHATWG URL Specification](https://url.spec.whatwg.org). @@ -22,8 +23,8 @@ For detailed information on the parsing process and potential validation errors, * **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)` -* **requestTls** `BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the request. See [TLS](https://nodejs.org/api/tls.html#tlsconnectoptions-callback). -* **proxyTls** `BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the proxy server. See [TLS](https://nodejs.org/api/tls.html#tlsconnectoptions-callback). +* **requestTls** `BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the request. It extends from [`Client#ConnectOptions`](/docs/docs/api/Client.md#parameter-connectoptions). +* **proxyTls** `BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the proxy server. It extends from [`Client#ConnectOptions`](/docs/docs/api/Client.md#parameter-connectoptions). Examples: @@ -35,6 +36,13 @@ const proxyAgent = new ProxyAgent('my.proxy.server') const proxyAgent = new ProxyAgent(new URL('my.proxy.server')) // or const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server' }) +// or +const proxyAgent = new ProxyAgent({ + uri: new URL('my.proxy.server'), + proxyTls: { + signal: AbortSignal.timeout(1000) + } +}) ``` #### Example - Basic ProxyAgent instantiation