node-http-proxy-ttfb-timeout

Implement TTFB timeouts for Node.js HTTP proxy keep-alive connections.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/hubeiqiao/skills --skill node-http-proxy-ttfb-timeout
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: node-http-proxy-ttfb-timeout
Source: https://github.com/hubeiqiao/skills/tree/main/node-http-proxy-ttfb-timeout
Command: npx skills add https://github.com/hubeiqiao/skills --skill node-http-proxy-ttfb-timeout

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill resolves issues where Node.js HTTP proxy requests hang indefinitely on keep-alive connections, ensuring reliable Time-To-First-Byte (TTFB) timeouts.

Core Features & Use Cases

  • Reliable TTFB Timeout: Implements a robust timeout mechanism that works for both new and reused HTTP/S connections.
  • Keep-Alive Connection Safety: Specifically addresses the race conditions that cause timeouts to fail on persistent connections.
  • Use Case: When your Node.js reverse proxy experiences requests that hang forever after the first successful one, especially when the upstream service might become temporarily unavailable.

Quick Start

Use the node-http-proxy-ttfb-timeout skill to implement a reliable TTFB timeout for your Node.js HTTP proxy.

Frequently Asked Questions about node-http-proxy-ttfb-timeout

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my Node.js HTTP proxy requests hang on keep-alive connections after the first successful one?▼

Node.js HTTP proxy requests hang on keep-alive connections because standard timeouts often fail to trigger on reused sockets, requiring a reliable Time-To-First-Byte (TTFB) timeout mechanism to detect upstream service unresponsiveness.

How do I implement a TTFB timeout for a Node.js reverse proxy?▼

To implement a TTFB timeout for a Node.js reverse proxy, apply a timeout mechanism that safely monitors both new and reused HTTP/S connections, ensuring timely failure detection when upstream services become temporarily unavailable.

Does Node.js http.request support reliable timeouts on reused keep-alive sockets?▼

Node.js http.request does not natively guarantee reliable timeouts on reused keep-alive sockets due to race conditions, making a dedicated TTFB timeout implementation necessary for robust failure detection.

What is the best way to fix hanging requests in a Node.js reverse proxy?▼

The best way to fix hanging requests in a Node.js reverse proxy is to implement a robust Time-To-First-Byte (TTFB) timeout that handles keep-alive connection race conditions across http.request and https.request.

When do I need a TTFB timeout for HTTP proxying?▼

You need a TTFB timeout for HTTP proxying when your upstream service might become temporarily unstable, causing subsequent requests on persistent keep-alive connections to fail to complete indefinitely.

Can I use the same timeout mechanism for both http.request and https.request?▼

Yes, you can use the same robust TTFB timeout mechanism for both http.request and https.request to ensure consistent timeout handling and timely failure detection across your Node.js reverse proxy implementation.