From d5059ea53766c1a147dbf7676698e2cc509b8e80 Mon Sep 17 00:00:00 2001 From: Koushil Mankali <65667531+koushil-mankali@users.noreply.github.com> Date: Sat, 8 Nov 2025 19:54:11 +0530 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca --- doc/api/http.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index e604509b337..82e42fdc24d 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -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