From bd3cc459526ea0b171db5b40cf303be6a04724d3 Mon Sep 17 00:00:00 2001 From: Artem Salpagarov Date: Mon, 8 Feb 2016 17:54:14 +0300 Subject: [PATCH] Add ability to specify endpoint key --- lib/http.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index 7c6d753..2545961 100644 --- a/lib/http.js +++ b/lib/http.js @@ -861,6 +861,7 @@ function Agent(options) { this._settings = options.settings; this._log = (options.log || defaultLogger).child({ component: 'http' }); + this._endpointKey = options.endpointKey; this.endpoints = {}; // * Using an own HTTPS agent, because the global agent does not look at `NPN/ALPNProtocols` when @@ -900,7 +901,7 @@ Agent.prototype.request = function request(options, callback) { request.on('response', callback); } - var key = [ + var key = this._endpointKey || [ !!options.plain, options.host, options.port