mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
doc: add missing variable in code snippet
`node:http`' `request.reusedSocket` documentation sample code was referencing an undeclared `agent` identifier. PR-URL: https://github.com/nodejs/node/pull/55478 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
2892d151d4
commit
a9c70cefe8
1 file changed
+2
@@ -1172,6 +1172,7 @@ may run into a 'ECONNRESET' error.
|
||||
|
||||
```mjs
|
||||
import http from 'node:http';
|
||||
const agent = new http.Agent({ keepAlive: true });
|
||||
|
||||
// Server has a 5 seconds keep-alive timeout by default
|
||||
http
|
||||
@@ -1193,6 +1194,7 @@ setInterval(() => {
|
||||
|
||||
```cjs
|
||||
const http = require('node:http');
|
||||
const agent = new http.Agent({ keepAlive: true });
|
||||
|
||||
// Server has a 5 seconds keep-alive timeout by default
|
||||
http
|
||||
|
||||
Reference in new issue
Block a user