mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -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
900de373ae
commit
d5059ea537
1 file changed
+2
@@ -1171,6 +1171,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
|
||||
@@ -1192,6 +1193,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