Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.216.250
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
node-undici /
api /
Delete
Unzip
Name
Size
Permission
Date
Action
Agent.md
2.73
KB
-rw-r--r--
2023-10-11 19:12
BalancedPool.md
2.75
KB
-rw-r--r--
2023-10-11 19:12
CacheStorage.md
1.05
KB
-rw-r--r--
2023-10-11 19:12
Client.md.gz
3.4
KB
-rw-r--r--
2023-10-11 19:12
Connector.md
3.38
KB
-rw-r--r--
2023-10-11 19:12
ContentType.md
1.1
KB
-rw-r--r--
2023-10-11 19:12
Cookies.md
2
KB
-rw-r--r--
2023-10-11 19:12
DiagnosticsChannel.md.gz
1.38
KB
-rw-r--r--
2023-10-11 19:12
DispatchInterceptor.md
1.49
KB
-rw-r--r--
2023-10-11 19:12
Dispatcher.md.gz
6.55
KB
-rw-r--r--
2023-10-11 19:12
Errors.md
3.48
KB
-rw-r--r--
2023-10-11 19:12
Fetch.md
1.17
KB
-rw-r--r--
2023-10-11 19:12
MockAgent.md.gz
2.97
KB
-rw-r--r--
2023-10-11 19:12
MockClient.md
1.97
KB
-rw-r--r--
2023-10-11 19:12
MockErrors.md
595
B
-rw-r--r--
2023-10-11 19:12
MockPool.md.gz
2.95
KB
-rw-r--r--
2023-10-11 19:12
Pool.md
2.7
KB
-rw-r--r--
2023-10-11 19:12
PoolStats.md
775
B
-rw-r--r--
2023-10-11 19:12
ProxyAgent.md
3.72
KB
-rw-r--r--
2023-10-11 19:12
WebSocket.md
1.46
KB
-rw-r--r--
2023-10-11 19:12
api-lifecycle.md.gz
2.62
KB
-rw-r--r--
2023-10-11 19:12
Save
Rename
# Class: ProxyAgent Extends: `undici.Dispatcher` A Proxy Agent class that implements the Agent API. It allows the connection through proxy in a simple way. ## `new ProxyAgent([options])` Arguments: * **options** `ProxyAgentOptions` (required) - It extends the `Agent` options. Returns: `ProxyAgent` ### Parameter: `ProxyAgentOptions` Extends: [`AgentOptions`](Agent.md#parameter-agentoptions) * **uri** `string` (required) - It can be passed either by a string or a object containing `uri` as 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)` * **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). Examples: ```js import { ProxyAgent } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') // or const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server' }) ``` #### Example - Basic ProxyAgent instantiation This will instantiate the ProxyAgent. It will not do anything until registered as the agent to use with requests. ```js import { ProxyAgent } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') ``` #### Example - Basic Proxy Request with global agent dispatcher ```js import { setGlobalDispatcher, request, ProxyAgent } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') setGlobalDispatcher(proxyAgent) const { statusCode, body } = await request('http://localhost:3000/foo') console.log('response received', statusCode) // response received 200 for await (const data of body) { console.log('data', data.toString('utf8')) // data foo } ``` #### Example - Basic Proxy Request with local agent dispatcher ```js import { ProxyAgent, request } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') const { statusCode, body } = await request('http://localhost:3000/foo', { dispatcher: proxyAgent }) console.log('response received', statusCode) // response received 200 for await (const data of body) { console.log('data', data.toString('utf8')) // data foo } ``` #### Example - Basic Proxy Request with authentication ```js import { setGlobalDispatcher, request, ProxyAgent } from 'undici'; const proxyAgent = new ProxyAgent({ uri: 'my.proxy.server', // token: 'Bearer xxxx' token: `Basic ${Buffer.from('username:password').toString('base64')}` }); setGlobalDispatcher(proxyAgent); const { statusCode, body } = await request('http://localhost:3000/foo'); console.log('response received', statusCode); // response received 200 for await (const data of body) { console.log('data', data.toString('utf8')); // data foo } ``` ### `ProxyAgent.close()` Closes the proxy agent and waits for registered pools and clients to also close before resolving. Returns: `Promise<void>` #### Example - clean up after tests are complete ```js import { ProxyAgent, setGlobalDispatcher } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') setGlobalDispatcher(proxyAgent) await proxyAgent.close() ``` ### `ProxyAgent.dispatch(options, handlers)` Implements [`Agent.dispatch(options, handlers)`](Agent.md#parameter-agentdispatchoptions). ### `ProxyAgent.request(options[, callback])` See [`Dispatcher.request(options [, callback])`](Dispatcher.md#dispatcherrequestoptions-callback).