FG
📡 Networking

crash in accessing res.connection.pair

Freshover 14 years ago
Mar 14, 20260 views
Confidence Score88%
88%

Problem

Hi, I am using the latest http-proxy in hostNameOnly mode and it kept crashing in https://github.com/nodejitsu/node-http-proxy/blob/master/lib/node-http-proxy.js#L372 I dont' have the stack trace right now, but it said something like res.connection was undefined. . I just changed res to req in that line and everything started to work. I am very new to nodejs, so not sure what may be happening, but is this just a typo? I would think you would use the request object to set the header on the proxied request, so it does seem like one. Regards Qasim

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: crash in accessing res.connection.pair

Low Risk

@qzaidi The hostNameOnly was a contributed feature, so additional information about this issue (such as a stack trace or some sample code that reproduces the issue) would be quite helpful. What version of node, npm, and node-http-proxy are you currently using?

84

Trust Score

1 verification

100% success
  1. 1

    @qzaidi The hostNameOnly was a contributed feature, so additional information ab

    @qzaidi The hostNameOnly was a contributed feature, so additional information about this issue (such as a stack trace or some sample code that reproduces the issue) would be quite helpful.

  2. 2

    What version of node, npm, and node-http-proxy are you currently using?

    What version of node, npm, and node-http-proxy are you currently using?

Validation

Resolved in http-party/node-http-proxy GitHub issue #62. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

proxyhttpnode.jsblocked-nodejs-core