@noodleseed/one 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/author-loop.d.ts.map +1 -1
- package/dist/commands/author-loop.js +2 -2
- package/dist/commands/author-loop.js.map +1 -1
- package/dist/commands/catalog-dispatch.d.ts.map +1 -1
- package/dist/commands/catalog-dispatch.js +21 -2
- package/dist/commands/catalog-dispatch.js.map +1 -1
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +28 -11
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/first-run.d.ts +11 -0
- package/dist/first-run.d.ts.map +1 -1
- package/dist/first-run.js +19 -4
- package/dist/first-run.js.map +1 -1
- package/dist/project-scaffold-templates.d.ts +11 -0
- package/dist/project-scaffold-templates.d.ts.map +1 -0
- package/dist/project-scaffold-templates.js +359 -0
- package/dist/project-scaffold-templates.js.map +1 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +1 -323
- package/dist/project.js.map +1 -1
- package/dist/react.d.ts +2 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/validate.d.ts +12 -0
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +11 -0
- package/dist/validate.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +6 -9
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts +3 -3
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.js +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts +302 -7
- package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/components.js +39 -7
- package/node_modules/@noodle-borg/authoring/dist/react/components.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts +4 -2
- package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/index.js +2 -1
- package/node_modules/@noodle-borg/authoring/dist/react/index.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts +2618 -0
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts.map +1 -0
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js +110 -0
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js.map +1 -0
- package/node_modules/@noodle-borg/authoring/dist/react.d.ts +2 -2
- package/node_modules/@noodle-borg/authoring/dist/react.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react.js +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.d.ts +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.js +14 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts +25 -2
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +7 -3
- package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js +20 -8
- package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +2 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +6 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
- package/node_modules/@noodle-borg/connector-http/package.json +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js +8 -0
- package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +15 -21
- package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +8 -2
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +15 -21
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +8 -2
- package/node_modules/hono/dist/cjs/helper/css/common.js +3 -1
- package/node_modules/hono/dist/cjs/helper/css/index.js +9 -1
- package/node_modules/hono/dist/cjs/jsx/base.js +8 -14
- package/node_modules/hono/dist/cjs/jsx/components.js +41 -21
- package/node_modules/hono/dist/cjs/jsx/context.js +131 -5
- package/node_modules/hono/dist/cjs/jsx/streaming.js +9 -7
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -5
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +2 -2
- package/node_modules/hono/dist/cjs/utils/body.js +12 -4
- package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
- package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
- package/node_modules/hono/dist/helper/css/common.js +3 -1
- package/node_modules/hono/dist/helper/css/index.js +9 -1
- package/node_modules/hono/dist/jsx/base.js +15 -15
- package/node_modules/hono/dist/jsx/components.js +42 -22
- package/node_modules/hono/dist/jsx/context.js +129 -5
- package/node_modules/hono/dist/jsx/streaming.js +10 -8
- package/node_modules/hono/dist/middleware/cors/index.js +2 -5
- package/node_modules/hono/dist/middleware/serve-static/index.js +2 -2
- package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +1 -1
- package/node_modules/hono/dist/types/jsx/base.d.ts +1 -3
- package/node_modules/hono/dist/types/jsx/context.d.ts +39 -0
- package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
- package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
- package/node_modules/hono/dist/utils/body.js +12 -4
- package/node_modules/hono/dist/utils/buffer.js +2 -1
- package/node_modules/hono/dist/validator/validator.js +3 -3
- package/node_modules/hono/package.json +9 -10
- package/node_modules/tailwindcss/dist/chunk-HMCCH6MG.mjs +1 -0
- package/node_modules/tailwindcss/dist/default-theme.mjs +1 -1
- package/node_modules/tailwindcss/dist/lib.js +13 -13
- package/node_modules/tailwindcss/dist/lib.mjs +18 -18
- package/node_modules/tailwindcss/package.json +2 -2
- package/node_modules/undici/README.md +3 -2
- package/node_modules/undici/docs/docs/api/Agent.md +248 -44
- package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
- package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
- package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
- package/node_modules/undici/docs/docs/api/Client.md +365 -178
- package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
- package/node_modules/undici/docs/docs/api/Connector.md +118 -36
- package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
- package/node_modules/undici/docs/docs/api/Cookies.md +125 -47
- package/node_modules/undici/docs/docs/api/Debug.md +34 -18
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
- package/node_modules/undici/docs/docs/api/Dispatcher.md +479 -1093
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +101 -87
- package/node_modules/undici/docs/docs/api/Errors.md +503 -40
- package/node_modules/undici/docs/docs/api/EventSource.md +294 -32
- package/node_modules/undici/docs/docs/api/Fetch.md +680 -31
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -98
- package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
- package/node_modules/undici/docs/docs/api/Interceptors.md +355 -0
- package/node_modules/undici/docs/docs/api/MockAgent.md +314 -322
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
- package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
- package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
- package/node_modules/undici/docs/docs/api/MockPool.md +299 -263
- package/node_modules/undici/docs/docs/api/Pool.md +235 -43
- package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -63
- package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -26
- package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -77
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +264 -542
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +162 -186
- package/node_modules/undici/docs/docs/api/Util.md +68 -11
- package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
- package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +6 -4
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
- package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
- package/node_modules/undici/docs/docs/{GettingStarted.md → getting-started.md} +22 -19
- package/node_modules/undici/docs/docs/index.md +779 -0
- package/node_modules/undici/docs/docs/site.json +125 -0
- package/node_modules/undici/docs/docs/type-map.json +79 -0
- package/node_modules/undici/lib/api/api-request.js +7 -1
- package/node_modules/undici/lib/api/readable.js +47 -2
- package/node_modules/undici/lib/core/errors.js +20 -0
- package/node_modules/undici/lib/core/request.js +1 -1
- package/node_modules/undici/lib/core/util.js +24 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +92 -1
- package/node_modules/undici/lib/dispatcher/client-h2.js +322 -118
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -0
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +42 -7
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +4 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +1 -0
- package/node_modules/undici/lib/handler/retry-handler.js +57 -19
- package/node_modules/undici/lib/util/cache.js +8 -2
- package/node_modules/undici/lib/web/cookies/parse.js +20 -27
- package/node_modules/undici/lib/web/cookies/util.js +1 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +7 -18
- package/node_modules/undici/lib/web/eventsource/util.js +32 -1
- package/node_modules/undici/lib/web/fetch/body.js +43 -0
- package/node_modules/undici/lib/web/fetch/constants.js +1 -1
- package/node_modules/undici/lib/web/fetch/index.js +11 -2
- package/node_modules/undici/lib/web/fetch/request.js +1 -0
- package/node_modules/undici/lib/web/fetch/util.js +4 -1
- package/node_modules/undici/lib/web/websocket/receiver.js +20 -3
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
- package/node_modules/undici/lib/web/websocket/websocket.js +3 -1
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +6 -1
- package/node_modules/undici/types/cookies.d.ts +1 -1
- package/node_modules/undici/types/errors.d.ts +10 -0
- package/node_modules/undici/types/fetch.d.ts +1 -0
- package/node_modules/undici/types/handlers.d.ts +2 -0
- package/node_modules/undici/types/proxy-agent.d.ts +7 -0
- package/package.json +4 -4
- package/react/styles.css +510 -5
- package/react/styles.source.css +850 -0
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
- package/node_modules/tailwindcss/dist/chunk-XVOTX5KS.mjs +0 -1
|
@@ -1,52 +1,85 @@
|
|
|
1
|
-
#
|
|
1
|
+
# EnvHttpProxyAgent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!--introduced_in=v6.14.0-->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<!--type=module-->
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<!-- source_link=lib/dispatcher/env-http-proxy-agent.js -->
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> Stability: 2 - Stable
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`EnvHttpProxyAgent` is a [`Dispatcher`][] that reads its proxy configuration from
|
|
12
|
+
the `http_proxy`, `https_proxy`, and `no_proxy` environment variables and routes
|
|
13
|
+
requests through the appropriate proxy automatically. Import it from `undici`:
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* **options** `EnvHttpProxyAgentOptions` (optional) - extends the `Agent` options.
|
|
16
|
-
|
|
17
|
-
Returns: `EnvHttpProxyAgent`
|
|
18
|
-
|
|
19
|
-
### Parameter: `EnvHttpProxyAgentOptions`
|
|
20
|
-
|
|
21
|
-
Extends: [`AgentOptions`](/docs/docs/api/Agent.md#parameter-agentoptions)
|
|
22
|
-
|
|
23
|
-
* **httpProxy** `string` (optional) - When set, it will override the `HTTP_PROXY` environment variable.
|
|
24
|
-
* **httpsProxy** `string` (optional) - When set, it will override the `HTTPS_PROXY` environment variable.
|
|
25
|
-
* **noProxy** `string` (optional) - When set, it will override the `NO_PROXY` environment variable.
|
|
26
|
-
|
|
27
|
-
Examples:
|
|
28
|
-
|
|
29
|
-
```js
|
|
15
|
+
```mjs
|
|
30
16
|
import { EnvHttpProxyAgent } from 'undici'
|
|
31
|
-
|
|
32
|
-
const envHttpProxyAgent = new EnvHttpProxyAgent()
|
|
33
|
-
// or
|
|
34
|
-
const envHttpProxyAgent = new EnvHttpProxyAgent({ httpProxy: 'my.proxy.server:8080', httpsProxy: 'my.proxy.server:8443', noProxy: 'localhost' })
|
|
35
17
|
```
|
|
36
18
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
When `http_proxy` and `https_proxy` are both set, `http_proxy` is used for HTTP
|
|
20
|
+
requests and `https_proxy` is used for HTTPS requests. If only `http_proxy` is
|
|
21
|
+
set, it is used for both HTTP and HTTPS requests. If only `https_proxy` is set,
|
|
22
|
+
it is used only for HTTPS requests.
|
|
23
|
+
|
|
24
|
+
`no_proxy` is a comma- or space-separated list of hosts that must not be
|
|
25
|
+
proxied. Each entry may include a leading dot or `*.` wildcard (for example
|
|
26
|
+
`.example.com`) to match subdomains, and an optional `:port` suffix to restrict
|
|
27
|
+
the match to a specific port. A request bypasses the proxy when its host equals
|
|
28
|
+
an entry or is a subdomain of one. Setting `no_proxy` to `*` bypasses the proxy
|
|
29
|
+
for every request.
|
|
30
|
+
|
|
31
|
+
The uppercase variants `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are also
|
|
32
|
+
honored. When both the lowercase and uppercase forms of a variable are set, the
|
|
33
|
+
lowercase form takes precedence and the uppercase form is ignored. The `no_proxy`
|
|
34
|
+
value is re-read from the environment on demand, so changes to it after the agent
|
|
35
|
+
is created take effect on subsequent requests; this does not apply when `noProxy`
|
|
36
|
+
is passed as an option.
|
|
37
|
+
|
|
38
|
+
## Class: `EnvHttpProxyAgent`
|
|
39
|
+
|
|
40
|
+
<!-- YAML
|
|
41
|
+
added: v6.14.0
|
|
42
|
+
-->
|
|
43
|
+
|
|
44
|
+
* Extends: {Dispatcher}
|
|
45
|
+
|
|
46
|
+
### `new EnvHttpProxyAgent([options])`
|
|
47
|
+
|
|
48
|
+
<!-- YAML
|
|
49
|
+
added: v6.14.0
|
|
50
|
+
-->
|
|
51
|
+
|
|
52
|
+
* `options` {EnvHttpProxyAgentOptions} Extends the [`ProxyAgent`][] options
|
|
53
|
+
(except `uri`). (optional)
|
|
54
|
+
* `httpProxy` {string} When set, overrides the `http_proxy` and `HTTP_PROXY`
|
|
55
|
+
environment variables. (optional)
|
|
56
|
+
* `httpsProxy` {string} When set, overrides the `https_proxy` and
|
|
57
|
+
`HTTPS_PROXY` environment variables. (optional)
|
|
58
|
+
* `noProxy` {string} When set, overrides the `no_proxy` and `NO_PROXY`
|
|
59
|
+
environment variables. (optional)
|
|
60
|
+
* Returns: {EnvHttpProxyAgent}
|
|
61
|
+
|
|
62
|
+
Creates a new `EnvHttpProxyAgent`. Any options other than `httpProxy`,
|
|
63
|
+
`httpsProxy`, and `noProxy` are forwarded to the underlying [`Agent`][] and
|
|
64
|
+
[`ProxyAgent`][] instances. Constructing the agent only configures it; it does
|
|
65
|
+
not affect any request until it is registered as a dispatcher, either globally
|
|
66
|
+
with `setGlobalDispatcher()` or per-request through the `dispatcher` option.
|
|
67
|
+
|
|
68
|
+
```mjs
|
|
42
69
|
import { EnvHttpProxyAgent } from 'undici'
|
|
43
70
|
|
|
44
71
|
const envHttpProxyAgent = new EnvHttpProxyAgent()
|
|
72
|
+
// or, overriding the environment variables explicitly:
|
|
73
|
+
const envHttpProxyAgentWithOpts = new EnvHttpProxyAgent({
|
|
74
|
+
httpProxy: 'my.proxy.server:8080',
|
|
75
|
+
httpsProxy: 'my.proxy.server:8443',
|
|
76
|
+
noProxy: 'localhost'
|
|
77
|
+
})
|
|
45
78
|
```
|
|
46
79
|
|
|
47
|
-
#### Example -
|
|
80
|
+
#### Example - Proxied `fetch()` with the global dispatcher
|
|
48
81
|
|
|
49
|
-
```
|
|
82
|
+
```mjs
|
|
50
83
|
import { setGlobalDispatcher, fetch, EnvHttpProxyAgent } from 'undici'
|
|
51
84
|
|
|
52
85
|
const envHttpProxyAgent = new EnvHttpProxyAgent()
|
|
@@ -56,12 +89,12 @@ const response = await fetch('http://localhost:3000/foo')
|
|
|
56
89
|
|
|
57
90
|
console.log('response received', response.status) // response received 200
|
|
58
91
|
|
|
59
|
-
const data = await response.json() // data { foo:
|
|
92
|
+
const data = await response.json() // data { foo: 'bar' }
|
|
60
93
|
```
|
|
61
94
|
|
|
62
|
-
#### Example -
|
|
95
|
+
#### Example - Proxied `request()` with the global dispatcher
|
|
63
96
|
|
|
64
|
-
```
|
|
97
|
+
```mjs
|
|
65
98
|
import { setGlobalDispatcher, request, EnvHttpProxyAgent } from 'undici'
|
|
66
99
|
|
|
67
100
|
const envHttpProxyAgent = new EnvHttpProxyAgent()
|
|
@@ -76,17 +109,16 @@ for await (const data of body) {
|
|
|
76
109
|
}
|
|
77
110
|
```
|
|
78
111
|
|
|
79
|
-
#### Example -
|
|
112
|
+
#### Example - Proxied `request()` with a local dispatcher
|
|
80
113
|
|
|
81
|
-
```
|
|
114
|
+
```mjs
|
|
82
115
|
import { EnvHttpProxyAgent, request } from 'undici'
|
|
83
116
|
|
|
84
117
|
const envHttpProxyAgent = new EnvHttpProxyAgent()
|
|
85
118
|
|
|
86
|
-
const {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} = await request('http://localhost:3000/foo', { dispatcher: envHttpProxyAgent })
|
|
119
|
+
const { statusCode, body } = await request('http://localhost:3000/foo', {
|
|
120
|
+
dispatcher: envHttpProxyAgent
|
|
121
|
+
})
|
|
90
122
|
|
|
91
123
|
console.log('response received', statusCode) // response received 200
|
|
92
124
|
|
|
@@ -95,62 +127,44 @@ for await (const data of body) {
|
|
|
95
127
|
}
|
|
96
128
|
```
|
|
97
129
|
|
|
98
|
-
#### Example -
|
|
130
|
+
#### Example - Proxied `fetch()` with a local dispatcher
|
|
99
131
|
|
|
100
|
-
```
|
|
132
|
+
```mjs
|
|
101
133
|
import { EnvHttpProxyAgent, fetch } from 'undici'
|
|
102
134
|
|
|
103
135
|
const envHttpProxyAgent = new EnvHttpProxyAgent()
|
|
104
136
|
|
|
105
|
-
const response = await fetch('http://localhost:3000/foo', {
|
|
137
|
+
const response = await fetch('http://localhost:3000/foo', {
|
|
138
|
+
dispatcher: envHttpProxyAgent
|
|
139
|
+
})
|
|
106
140
|
|
|
107
141
|
console.log('response received', response.status) // response received 200
|
|
108
142
|
|
|
109
|
-
const data = await response.json() // data { foo:
|
|
143
|
+
const data = await response.json() // data { foo: 'bar' }
|
|
110
144
|
```
|
|
111
145
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### `EnvHttpProxyAgent.close([callback])`
|
|
115
|
-
|
|
116
|
-
Implements [`Dispatcher.close([callback])`](/docs/docs/api/Dispatcher.md#dispatcherclosecallback-promise).
|
|
117
|
-
|
|
118
|
-
### `EnvHttpProxyAgent.destroy([error, callback])`
|
|
119
|
-
|
|
120
|
-
Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
|
|
121
|
-
|
|
122
|
-
### `EnvHttpProxyAgent.dispatch(options, handler: AgentDispatchOptions)`
|
|
123
|
-
|
|
124
|
-
Implements [`Dispatcher.dispatch(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
|
|
125
|
-
|
|
126
|
-
#### Parameter: `AgentDispatchOptions`
|
|
127
|
-
|
|
128
|
-
Extends: [`DispatchOptions`](/docs/docs/api/Dispatcher.md#parameter-dispatchoptions)
|
|
129
|
-
|
|
130
|
-
* **origin** `string | URL`
|
|
131
|
-
|
|
132
|
-
Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
|
|
133
|
-
|
|
134
|
-
### `EnvHttpProxyAgent.connect(options[, callback])`
|
|
135
|
-
|
|
136
|
-
See [`Dispatcher.connect(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherconnectoptions-callback).
|
|
137
|
-
|
|
138
|
-
### `EnvHttpProxyAgent.dispatch(options, handler)`
|
|
139
|
-
|
|
140
|
-
Implements [`Dispatcher.dispatch(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
|
|
141
|
-
|
|
142
|
-
### `EnvHttpProxyAgent.pipeline(options, handler)`
|
|
143
|
-
|
|
144
|
-
See [`Dispatcher.pipeline(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler).
|
|
145
|
-
|
|
146
|
-
### `EnvHttpProxyAgent.request(options[, callback])`
|
|
146
|
+
### `envHttpProxyAgent.dispatch(options, handler)`
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
<!-- YAML
|
|
149
|
+
added: v6.14.0
|
|
150
|
+
-->
|
|
149
151
|
|
|
150
|
-
|
|
152
|
+
* `options` {AgentDispatchOptions}
|
|
153
|
+
* `origin` {string|URL}
|
|
154
|
+
* `handler` {DispatchHandler}
|
|
155
|
+
* Returns: {boolean}
|
|
151
156
|
|
|
152
|
-
|
|
157
|
+
Dispatches a request through the proxy selected for `options.origin`. The origin's
|
|
158
|
+
protocol, host, and port are compared against the `no_proxy` configuration: when
|
|
159
|
+
the host should be proxied, the request is routed to the HTTPS proxy agent for
|
|
160
|
+
`https:` origins or the HTTP proxy agent otherwise; when the host is excluded by
|
|
161
|
+
`no_proxy`, the request is sent directly through a non-proxying [`Agent`][].
|
|
153
162
|
|
|
154
|
-
|
|
163
|
+
This method is not normally called directly. Use the higher-level
|
|
164
|
+
[`Dispatcher`][] methods such as [`dispatcher.request()`][] or the top-level
|
|
165
|
+
`request()` and `fetch()` helpers instead.
|
|
155
166
|
|
|
156
|
-
|
|
167
|
+
[`Agent`]: Agent.md#class-agent
|
|
168
|
+
[`Dispatcher`]: Dispatcher.md#class-dispatcher
|
|
169
|
+
[`ProxyAgent`]: ProxyAgent.md#class-proxyagent
|
|
170
|
+
[`dispatcher.request()`]: Dispatcher.md#dispatcherrequestoptions-callback
|