Skip to content

Commit ca91969

Browse files
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 e9ef0a1 commit ca91969

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

11751175
```mjs
11761176
import http from 'node:http';
1177+
const agent = new http.Agent({ keepAlive: true });
11771178

11781179
// Server has a 5 seconds keep-alive timeout by default
11791180
http
@@ -1195,6 +1196,7 @@ setInterval(() => {
11951196

11961197
```cjs
11971198
const http = require('node:http');
1199+
const agent = new http.Agent({ keepAlive: true });
11981200

11991201
// Server has a 5 seconds keep-alive timeout by default
12001202
http

0 commit comments

Comments
 (0)