8000 doc: add missing variable in code snippet · nodejs/node@d5059ea · GitHub
[go: up one dir, main page]

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 <ethan@arrowood.dev> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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
< 8481 td data-grid-cell-id="diff-d692ac4524379ec6a1201165e8ff8d3267c8130e07014e8221ebf7e6f80c6641-1172-1172-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">1172
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ may run into a 'ECONNRESET' error.
11711171

1172
```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)
0