diff --git a/lib/client.js b/lib/client.js index e30c3b4..9a9839c 100644 --- a/lib/client.js +++ b/lib/client.js @@ -3,6 +3,7 @@ var https = require("https"); var json = require("./json"); var url = require("url"); var util = require("util"); +var _ = require('lodash'); /*section: client *comment: | @@ -15,6 +16,7 @@ var client = function(){ this.api_key = null; this.app_key = null; this.proxy_agent = null; + this.http_options = null; this.api_version = "v1"; this.api_host = "app.datadoghq.com"; }; @@ -66,12 +68,12 @@ client.prototype.request = function(method, path, params, callback){ "query": query, }); - var http_options = { + var http_options = _.assign({ hostname: this.api_host, port: 443, method: method.toUpperCase(), path: path - }; + }, this.http_options); if(this.proxy_agent){ http_options["agent"] = this.proxy_agent; diff --git a/package.json b/package.json index cd65a83..f5d9cf5 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "extend": "^3.0.0", "json-bigint": "^0.1.4", "minimist": "^1.1.1", - "rc": "^1.0.0" + "rc": "^1.0.0", + "lodash": "latest" }, "devDependencies": { "bignumber.js": "^2.0.7",