Skip to content

Commit 4dc141b

Browse files
committed
address pr reviews
1 parent 4012416 commit 4dc141b

File tree

1 file changed

+2
-3
lines changed
  • src/content/docs/workers/runtime-apis/nodejs

1 file changed

+2
-3
lines changed

src/content/docs/workers/runtime-apis/nodejs/http.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ The `cloudflare.cf` property contains [Cloudflare-specific request properties](/
173173
The following differences exist between the Workers implementation and Node.js:
174174

175175
- Trailer headers are not supported
176-
- The `socket` attribute only contains the following properties: `encrypted`, `remoteFamily`, `remoteAddress`, `remotePort`, `localAddress`, `localPort`, and `destroy()` method
177-
- The `socket` attribute does not extend from `net.Socket`
176+
- The `socket` attribute **does not extend from `net.Socket`** and only contains the following properties: `encrypted`, `remoteFamily`, `remoteAddress`, `remotePort`, `localAddress`, `localPort`, and `destroy()` method
178177

179178
## createServer
180179

@@ -198,7 +197,7 @@ export default httpServerHandler({ port: 8080 });
198197
The `httpServerHandler` function integrates Node.js HTTP servers with the Cloudflare Workers request model. When a request arrives at your Worker, the handler automatically routes it to your Node.js server running on the specified port. This bridge allows you to use familiar Node.js server patterns while benefiting from the Workers runtime environment, including automatic scaling, edge deployment, and integration with other Cloudflare services.
199198

200199
:::note
201-
Failing to call `close()` on an HTTP server may result in the server being leaked. To prevent this, call `close()` when you're done with the server, or use explicit resource management:
200+
Failing to call `close()` on an HTTP server may result in the server persisting until the worker is destroyed. In most cases, this is not an issue since servers typically live for the lifetime of the worker. However, if you need to create multiple servers during a worker's lifetime or want explicit lifecycle control (such as in test scenarios), call `close()` when you're done with the server, or use explicit resource management:
202201

203202
```js
204203
import { createServer } from 'node:http';

0 commit comments

Comments
 (0)