FG
📡 Networking

RoutingProxy.proxyRequest modifies the options parameter

Freshabout 13 years ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

Node: v0.7.6 http-proxy: v0.8.0 (via NPM) MacOS Problem: RoutingProxy.prototype.proxyRequest modifies the 'options' parameter by adding new properties to the object. This is unexpected and leads to unintended consequences as described below. I was expecting the API to not modify the options parameter. Scenario: I have a single node process that runs two reverse proxies on two different TCP ports: an HTTPS->HTTP proxy and HTTP->HTTP proxy. The two reverse proxies use two instances of RoutingProxy, but the data structure that defines routing rules is shared between the two proxies. Specifically, the object instance I pass as 'options' parameter to RoutingProxy.proxyRequest has a global lifetime. What I notice is that whenever the first routing request is HTTPS, the modifications RoutingProxy.proxyRequest makes in the 'options' parameter cause subsequent HTTP routing requests to fail. It appears that the RoutingProxy is picking HTTPS module instead of HTTP to make the outbound request to the backend.

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: RoutingProxy.proxyRequest modifies the options parameter

Low Risk

Could you create a failing test that replicates the issue?

84

Trust Score

1 verification

100% success
  1. 1

    Could you create a failing test that replicates the issue?

    Could you create a failing test that replicates the issue?

Validation

Resolved in http-party/node-http-proxy GitHub issue #248. 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.js