Skip to content

Commit

Permalink
Добавил проброс agent в запросах к Метрике
Browse files Browse the repository at this point in the history
  • Loading branch information
hcodes committed May 14, 2019
1 parent 0888905 commit c4014a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yametrika.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -277,6 +279,7 @@ class Counter {
+ '&' + querystring.stringify(data);

const req = https.request({
agent: this._agent,
host: HOST,
port: PORT,
path: path,
Expand Down

0 comments on commit c4014a6

Please sign in to comment.