Skip to content

Commit 3500f71

Browse files
committed
docs: update ProxyAgent documentation
1 parent 902b801 commit 3500f71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/api/ProxyAgent.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Returns: `ProxyAgent`
1616

1717
Extends: [`AgentOptions`](Agent.md#parameter-agentoptions)
1818

19-
* **uri** `string` (required) - It can be passed either by a string or a object containing `uri` as string.
19+
* **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.
2020
* **token** `string` (optional) - It can be passed by a string of token for authentication.
2121
* **auth** `string` (**deprecated**) - Use token.
2222
* **clientFactory** `(origin: URL, opts: Object) => Dispatcher` (optional) - Default: `(origin, opts) => new Pool(origin, opts)`
@@ -30,6 +30,8 @@ import { ProxyAgent } from 'undici'
3030

3131
const proxyAgent = new ProxyAgent('my.proxy.server')
3232
// or
33+
const proxyAgent = new ProxyAgent(new URL('my.proxy.server'))
34+
// or
3335
const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server' })
3436
```
3537

0 commit comments

Comments
 (0)