Skip to content

Commit a9c70ce

Browse files
koushil-mankaliaduh95
authored andcommitted
doc: add missing variable in code snippet
`node:http`' `request.reusedSocket` documentation sample code was referencing an undeclared `agent` identifier. PR-URL: #55478 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2892d15 commit a9c70ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/http.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ may run into a 'ECONNRESET' error.
11721172

11731173
```mjs
11741174
import http from 'node:http';
1175+
const agent = new http.Agent({ keepAlive: true });
11751176

11761177
// Server has a 5 seconds keep-alive timeout by default
11771178
http
@@ -1193,6 +1194,7 @@ setInterval(() => {
11931194

11941195
```cjs
11951196
const http = require('node:http');
1197+
const agent = new http.Agent({ keepAlive: true });
11961198

11971199
// Server has a 5 seconds keep-alive timeout by default
11981200
http

0 commit comments

Comments
 (0)