From c4014a6c6fcfdbb42659c32d2b0fa2e29bff2739 Mon Sep 17 00:00:00 2001 From: Denis Seleznev Date: Tue, 14 May 2019 10:28:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D1=80=D0=BE=D1=81=20agent=20=D0=B2=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0=D1=85=20=D0=BA=20?= =?UTF-8?q?=D0=9C=D0=B5=D1=82=D1=80=D0=B8=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yametrika.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yametrika.js b/yametrika.js index b9770db..adeabf8 100644 --- a/yametrika.js +++ b/yametrika.js @@ -23,11 +23,13 @@ class Counter { * @param {string|number} settings.id - Номер счётчика. * @param {number} [settings.type] - Тип счётчика: 0 - обычный счётчик, 1 - РСЯ-счётчик. * @param {Function} [settings.onerror] - Для отладки сетевых ошибок. + * @param {https.Agent} [settings.agent] */ constructor(settings) { this._id = settings.id; this._type = settings.type || 0; this._onerror = settings.onerror; + this._agent = settings.agent; this._request = { host: null, @@ -277,6 +279,7 @@ class Counter { + '&' + querystring.stringify(data); const req = https.request({ + agent: this._agent, host: HOST, port: PORT, path: path,