Skip to content

Commit ee93584

Browse files
authored
docs: enhance documentation (#3945)
1 parent ff18d8c commit ee93584

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/docs/api/ProxyAgent.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ Returns: `ProxyAgent`
1515
### Parameter: `ProxyAgentOptions`
1616

1717
Extends: [`AgentOptions`](/docs/docs/api/Agent.md#parameter-agentoptions)
18+
> It ommits `AgentOptions#connect`.
1819
1920
* **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.
2021
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).
2122
For detailed information on the parsing process and potential validation errors, please refer to the ["Writing" section](https://url.spec.whatwg.org/#writing) of the WHATWG URL Specification.
2223
* **token** `string` (optional) - It can be passed by a string of token for authentication.
2324
* **auth** `string` (**deprecated**) - Use token.
2425
* **clientFactory** `(origin: URL, opts: Object) => Dispatcher` (optional) - Default: `(origin, opts) => new Pool(origin, opts)`
25-
* **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).
26-
* **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).
26+
* **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).
27+
* **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).
2728

2829
Examples:
2930

@@ -35,6 +36,13 @@ const proxyAgent = new ProxyAgent('my.proxy.server')
3536
const proxyAgent = new ProxyAgent(new URL('my.proxy.server'))
3637
// or
3738
const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server' })
39+
// or
40+
const proxyAgent = new ProxyAgent({
41+
uri: new URL('my.proxy.server'),
42+
proxyTls: {
43+
signal: AbortSignal.timeout(1000)
44+
}
45+
})
3846
```
3947

4048
#### Example - Basic ProxyAgent instantiation

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy