Skip to content

Commit d5059ea

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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 900de37 commit d5059ea

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
@@ -1171,6 +1171,7 @@ may run into a 'ECONNRESET' error.
11711171

11721172
```mjs
11731173
import http from 'node:http';
1174+
const agent = new http.Agent({ keepAlive: true });
11741175

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

11931194
```cjs
11941195
const http = require('node:http');
1196+
const agent = new http.Agent({ keepAlive: true });
11951197

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

0 commit comments

Comments
 (0)