diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 3af18a051c..f973c34425 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -128,6 +128,15 @@ Agent.prototype.getName = function(options) { }; Agent.prototype.addRequest = function(req, options) { + // Legacy API: addRequest(req, host, port, path) + if (typeof options === 'string') { + options = { + host: options, + port: arguments[2], + path: arguments[3] + }; + } + var host = options.host; var port = options.port; var localAddress = options.localAddress;