You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move the `Agent` part of the docs to the end since it's only
a stub impl and really isn't all that useful. Also improve the
example to show how one might actually use it.
Copy file name to clipboardExpand all lines: src/content/docs/workers/runtime-apis/nodejs/http.mdx
+28-18Lines changed: 28 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,6 @@ import { Render } from "~/components"
7
7
8
8
<Renderfile="nodejs-compat-howto" />
9
9
10
-
## Agent
11
-
12
-
An implementation of the Node.js [`http.Agent'](https://nodejs.org/docs/latest/api/http.html#class-httpagent) class.
13
-
14
-
An [Agent](https://nodejs.org/docs/latest/api/http.html#class-httpagent) manages HTTP connection reuse by maintaining request queues per host/port. In the
15
-
workers environment, however, such low-level management of the network connection, ports,
16
-
etc, is not relevant because it is handled by the Cloudflare infrastructure instead. Accordingly, the
17
-
implementation of `Agent` in Workers is a stub implementation that does not support connection
18
-
pooling or keep-alive.
19
-
20
-
```js
21
-
import { Agent } from'node:http';
22
-
import { strictEqual } from'node:assert';
23
-
24
-
constagent=newAgent();
25
-
strictEqual(agent.protocol, 'http:');
26
-
```
27
-
28
10
## get
29
11
30
12
An implementation of the Node.js [`http.get`](https://nodejs.org/docs/latest/api/http.html#httpgetoptions-callback) method.
A partial implementation of the Node.js [`http.Agent'](https://nodejs.org/docs/latest/api/http.html#class-httpagent) class.
112
+
113
+
An `Agent` manages HTTP connection reuse by maintaining request queues per host/port. In the workers environment, however, such low-level management of the network connection, ports, etc, is not relevant because it is handled by the Cloudflare infrastructure instead. Accordingly, the implementation of `Agent` in Workers is a stub implementation that does not support connection pooling or keep-alive.
Copy file name to clipboardExpand all lines: src/content/docs/workers/runtime-apis/nodejs/https.mdx
+28-18Lines changed: 28 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,6 @@ import { Render } from "~/components";
7
7
8
8
<Renderfile="nodejs-compat-howto" />
9
9
10
-
## Agent
11
-
12
-
An implementation of the Node.js [`https.Agent'](https://nodejs.org/docs/latest/api/https.html#class-httpsagent) class.
13
-
14
-
An [Agent](https://nodejs.org/docs/latest/api/https.html#class-httpsagent) manages HTTPS connection reuse by maintaining request queues per host/port. In the
15
-
workers environment, however, such low-level management of the network connection, ports,
16
-
etc, is not relevant because it is handled by the Cloudflare infrastructure instead. Accordingly, the
17
-
implementation of `Agent` in Workers is a stub implementation that does not support connection
18
-
pooling or keep-alive.
19
-
20
-
```js
21
-
import { Agent } from"node:https";
22
-
import { strictEqual } from"node:assert";
23
-
24
-
constagent=newAgent();
25
-
strictEqual(agent.protocol, "https:");
26
-
```
27
-
28
10
## get
29
11
30
12
An implementation of the Node.js [`https.get'](https://nodejs.org/docs/latest/api/https.html#httpsgetoptions-callback) method.
@@ -90,3 +72,31 @@ req.end();
90
72
```
91
73
92
74
The following additional options are not supported: `ca`, `cert`, `ciphers`, `clientCertEngine` (deprecated), `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`, `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`.
75
+
76
+
## Agent
77
+
78
+
An implementation of the Node.js [`https.Agent'](https://nodejs.org/docs/latest/api/https.html#class-httpsagent) class.
79
+
80
+
An `Agent` manages HTTPS connection reuse by maintaining request queues per host/port. In the workers environment, however, such low-level management of the network connection, ports, etc, is not relevant because it is handled by the Cloudflare infrastructure instead. Accordingly, the implementation of `Agent` in Workers is a stub implementation that does not support connection pooling or keep-alive.
0 commit comments