Node 0.11 and https proxy #779

ksato9700 opened this Issue Jan 19, 2014 · 6 comments


None yet
5 participants

ksato9700 commented Jan 19, 2014


I tried to get an https URL with proxy option, and got the following error.

TypeError: Request path contains unescaped characters.

The error happens only with Node.js v0.11.x, and I guess this is due to an incompatible change made in 0.11.

I tried the HEAD version of mikeal/tunnel-agent and found it works well. So, it would be nice if you can put a new tag on the HEAD version and refer it from the package.json of request.

Thank you.

DarrylD commented Jan 22, 2014

@ksato9700 I'm having the same issue as we speak, can you elaborate on your fix? ( "I tried the HEAD version of mikeal/tunnel-agent and found it works well.")

I changed to tunnel-agent@0.3.1 and get this error
Error: read ECONNRESET at exports._errnoException (util.js:682:11) at TCP.onread (net.js:530:26)

Would help a lot, thanks!


ksato9700 commented Jan 22, 2014

@darryid v0.3.1 doesn't include the required change. Try this.
(cd node_modules/request; npm install git+

As you see a different error message, you might already tried this, though. If it is the case, I would suggest to check if you set the proxy parameter properly and check if the proxy server is actually running ...


ghostoy commented Feb 10, 2014

Seems that latest node.js changed their Agent API on which tunnel-agent depends. Upgrading to >0.4.0 should fix this error.

ksato9700 added a commit to ksato9700/request that referenced this issue Feb 12, 2014

upgrade tunnel-proxy to 0.4.0
  to avoid node 0.11.x issue (#779)

ksato9700 commented Feb 12, 2014

Thank you, @ghostoy. I have submitted a pull request to include the suggested change.

chrismilleruk added a commit to chrismilleruk/nano that referenced this issue Aug 26, 2014

Please upgrade request to v2.40.0
This fixes an issue with SSL proxying in node v0.11.

seanstrom commented Oct 14, 2014

This seems to be resolved since we upgraded tunnel-agent with #809

@seanstrom seanstrom closed this Oct 14, 2014

nylen pushed a commit to nylen/request that referenced this issue Oct 17, 2014

upgrade tunnel-proxy to 0.4.0
  to avoid node 0.11.x issue (#779)

@radum radum referenced this issue in evanlucas/gcr Feb 19, 2015


added proxy support #10

Hi. For all people stuck with outdated request versions (such as Cordova and its old libnpm, or the "Ripple" emulator), you may patch the problematic node_modules/request/tunnel.js (or ../tunnel-agent/index.js) by adding these lines at the beginning of addRequest() at line ~73 :

   // alternative method signature : addRequest(req, obj) with obj containing host and port strings as attributes
  if (typeof host == typeof {}) {
     port = host.uri.port;
     host =;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment