Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Looks like this may fix the issue that I reported #39

Merged
merged 1 commit into from

2 participants

@timmattison

My installation doesn't like the parameters passed as "http, port" to getAgent. I think instanceof may want these variables to be instantiated with the String constructor according to some JavaScript documentation found online but I'm not sure.

In this patch all I did was create an options object and used it in both the HTTP and HTTPS constructors. After that the examples work again.

@indexzero indexzero referenced this pull request from a commit
@indexzero indexzero Merged pull request #39 from timmattison/master.
Looks like this may fix the issue that I reported
ac425d7
@indexzero indexzero merged commit ac425d7 into nodejitsu:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 6 deletions.
  1. +4 −6 lib/node-http-proxy.js
View
10 lib/node-http-proxy.js
@@ -45,11 +45,9 @@ exports.version = [0, 5, 0];
// and sets the `maxSockets` property appropriately.
//
function _getAgent (host, port, secure) {
- var agent = !secure ? http.getAgent(host, port) : https.getAgent({
- host: host,
- port: port
- });
-
+ var options = { host: host, port: port };
+ var agent = !secure ? http.getAgent(options) : https.getAgent(options);
+
agent.maxSockets = maxSockets;
return agent;
}
@@ -668,4 +666,4 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options
if (options.buffer && !errState) {
options.buffer.resume();
}
-};
+};
Something went wrong with that request. Please try again.